diff options
author | Philip Paeps <philip@FreeBSD.org> | 2019-10-06 04:36:53 +0000 |
---|---|---|
committer | Philip Paeps <philip@FreeBSD.org> | 2019-10-06 04:36:53 +0000 |
commit | f91036a44a189fa5d0b5f1c6dea0a396a0f928c0 (patch) | |
tree | 2cd0554d9f0826a4e0bc63c5e4ca83ece65bee24 /print-tcp.c | |
parent | 810711ec13a9424633df50e0a1af057a68e2ed45 (diff) | |
download | src-f91036a44a189fa5d0b5f1c6dea0a396a0f928c0.tar.gz src-f91036a44a189fa5d0b5f1c6dea0a396a0f928c0.zip |
Vendor import of tcpdump 4.9.3
Notes
Notes:
svn path=/vendor/tcpdump/dist/; revision=353144
Diffstat (limited to 'print-tcp.c')
-rw-r--r-- | print-tcp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/print-tcp.c b/print-tcp.c index e0d0531b36b2..b80a2f264d45 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -267,11 +267,11 @@ tcp_print(netdissect_options *ndo, if (rev) { UNALIGNED_MEMCPY(&tha.src, dst, sizeof ip6->ip6_dst); UNALIGNED_MEMCPY(&tha.dst, src, sizeof ip6->ip6_src); - tha.port = dport << 16 | sport; + tha.port = ((u_int)dport) << 16 | sport; } else { UNALIGNED_MEMCPY(&tha.dst, dst, sizeof ip6->ip6_dst); UNALIGNED_MEMCPY(&tha.src, src, sizeof ip6->ip6_src); - tha.port = sport << 16 | dport; + tha.port = ((u_int)sport) << 16 | dport; } for (th = &tcp_seq_hash[tha.port % TSEQ_HASHSIZE]; @@ -318,11 +318,11 @@ tcp_print(netdissect_options *ndo, if (rev) { UNALIGNED_MEMCPY(&tha.src, &ip->ip_dst, sizeof ip->ip_dst); UNALIGNED_MEMCPY(&tha.dst, &ip->ip_src, sizeof ip->ip_src); - tha.port = dport << 16 | sport; + tha.port = ((u_int)dport) << 16 | sport; } else { UNALIGNED_MEMCPY(&tha.dst, &ip->ip_dst, sizeof ip->ip_dst); UNALIGNED_MEMCPY(&tha.src, &ip->ip_src, sizeof ip->ip_src); - tha.port = sport << 16 | dport; + tha.port = ((u_int)sport) << 16 | dport; } for (th = &tcp_seq_hash[tha.port % TSEQ_HASHSIZE]; @@ -714,6 +714,12 @@ tcp_print(netdissect_options *ndo, rtsp_print(ndo, bp, length); } else if (length > 2 && (IS_SRC_OR_DST_PORT(NAMESERVER_PORT))) { + /* domain_print() assumes it does not have to prepend a space before its + * own output to separate it from the output of the calling function. This + * works well with udp_print(), but requires a small prop here. + */ + ND_PRINT((ndo, " ")); + /* * TCP DNS query has 2byte length at the head. * XXX packet could be unaligned, it can go strange |