]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-tcp.c
IPX: Add a length check
[tcpdump] / print-tcp.c
index d2cb1520868f3e4b719d372e960915b6431a4ff4..66834e84fe7d2bdc2d620e7b8b63bba4bf96f978 100644 (file)
@@ -95,7 +95,7 @@ struct tcp_seq_hash6 {
 
 #define TSEQ_HASHSIZE 919
 
-/* These tcp optinos do not have the size octet */
+/* These tcp options do not have the size octet */
 #define ZEROLENOPT(o) ((o) == TCPOPT_EOL || (o) == TCPOPT_NOP)
 
 static struct tcp_seq_hash tcp_seq_hash4[TSEQ_HASHSIZE];
@@ -709,7 +709,8 @@ tcp_print(netdissect_options *ndo,
                 smtp_print(ndo, bp, length);
         } else if (IS_SRC_OR_DST_PORT(WHOIS_PORT)) {
                 ND_PRINT(": ");
-                txtproto_print(ndo, bp, length, "whois", NULL, 0); /* RFC 3912 */
+                ndo->ndo_protocol = "whois";   /* needed by txtproto_print() */
+                txtproto_print(ndo, bp, length, NULL, 0); /* RFC 3912 */
         } else if (IS_SRC_OR_DST_PORT(BGP_PORT))
                 bgp_print(ndo, bp, length);
         else if (IS_SRC_OR_DST_PORT(PPTP_PORT))
@@ -832,7 +833,7 @@ print_tcp_rst_data(netdissect_options *ndo,
                 c = EXTRACT_U_1(sp);
                 sp++;
                 fn_print_char(ndo, c);
-               length--;
+                length--;
         }
         ND_PRINT("]");
 }