X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/925cee250fa8a6c9f1e20ba98417b74f4d4d2ef8..0181656313fbe514928263f4061d42d338a5bb7c:/print-tcp.c?ds=sidebyside diff --git a/print-tcp.c b/print-tcp.c index f3b635b4..d420382e 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -68,8 +68,8 @@ static void print_tcp_fastopen_option(netdissect_options *ndo, const u_char *cp, struct tha { - struct in_addr src; - struct in_addr dst; + nd_ipv4 src; + nd_ipv4 dst; u_int port; }; @@ -81,8 +81,8 @@ struct tcp_seq_hash { }; struct tha6 { - struct in6_addr src; - struct in6_addr dst; + nd_ipv6 src; + nd_ipv6 dst; u_int port; }; @@ -227,8 +227,8 @@ tcp_print(netdissect_options *ndo, hlen = TH_OFF(tp) * 4; if (hlen < sizeof(*tp)) { - ND_PRINT(" tcp %u [bad hdr length %u - too short, < %lu]", - length - hlen, hlen, (unsigned long)sizeof(*tp)); + ND_PRINT(" tcp %u [bad hdr length %u - too short, < %zu]", + length - hlen, hlen, sizeof(*tp)); return; } @@ -399,7 +399,7 @@ tcp_print(netdissect_options *ndo, else ND_PRINT(" (correct)"); } - } else if (IP_V(ip) == 6 && GET_BE_U_2(ip6->ip6_plen)) { + } else if (IP_V(ip) == 6) { if (ND_TTEST_LEN(tp->th_sport, length)) { sum = tcp6_cksum(ndo, ip6, tp, length); tcp_sum = GET_BE_U_2(tp->th_sum); @@ -702,6 +702,10 @@ tcp_print(netdissect_options *ndo, case PT_RESP: resp_print(ndo, bp, length); break; + case PT_DOMAIN: + ND_PRINT(" "); + domain_print(ndo, bp + 2, length - 2, 0); + break; } return; } @@ -721,6 +725,8 @@ tcp_print(netdissect_options *ndo, pptp_print(ndo, bp); else if (IS_SRC_OR_DST_PORT(REDIS_PORT)) resp_print(ndo, bp, length); + else if (IS_SRC_OR_DST_PORT(SSH_PORT)) + ssh_print(ndo, bp, length); #ifdef ENABLE_SMB else if (IS_SRC_OR_DST_PORT(NETBIOS_SSN_PORT)) nbt_tcp_print(ndo, bp, length);