From 27248a0ec1237b5e19cc931954815a6f96a4356e Mon Sep 17 00:00:00 2001 From: Michael Tuexen <tuexen@fh-muenster.de> Date: Tue, 15 Aug 2017 15:14:04 +0200 Subject: [PATCH] Improve printing of UDP encapulated TCP segments. Ensure that there is no space before /udp(). --- gtests/net/packetdrill/packet_to_string.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtests/net/packetdrill/packet_to_string.c b/gtests/net/packetdrill/packet_to_string.c index a9923760..226c0f82 100644 --- a/gtests/net/packetdrill/packet_to_string.c +++ b/gtests/net/packetdrill/packet_to_string.c @@ -202,23 +202,23 @@ static int tcp_packet_to_string(FILE *s, struct packet *packet, int i, if (packet->tcp->cwr) fputc('W', s); /* Congestion *W*indow reduced (ECN) */ - fprintf(s, " %u:%u(%u) ", + fprintf(s, " %u:%u(%u)", ntohl(packet->tcp->seq), ntohl(packet->tcp->seq) + packet_payload_len(packet), packet_payload_len(packet)); if (packet->tcp->ack) - fprintf(s, "ack %u ", ntohl(packet->tcp->ack_seq)); + fprintf(s, " ack %u", ntohl(packet->tcp->ack_seq)); if (!(packet->flags & FLAG_WIN_NOCHECK)) - fprintf(s, "win %u ", ntohs(packet->tcp->window)); + fprintf(s, " win %u", ntohs(packet->tcp->window)); if (packet_tcp_options_len(packet) > 0) { char *tcp_options = NULL; if (tcp_options_to_string(packet, &tcp_options, error)) result = STATUS_ERR; else - fprintf(s, "<%s>", tcp_options); + fprintf(s, " <%s>", tcp_options); free(tcp_options); } -- GitLab