]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-hsrp.c
TCP: Add a test with data in the RST segment
[tcpdump] / print-hsrp.c
index 7c7ad2182bf78295b27695ba456983a972d4e8e4..3027826847a9c84fe9a4df9e22c29ed2ba2b1b8e 100644 (file)
@@ -104,7 +104,6 @@ hsrp_print(netdissect_options *ndo, const u_char *bp, u_int len)
        ND_PRINT("HSRPv%u", version);
        if (version != 0)
                return;
-       ND_TCHECK_1(hp->hsrp_op_code);
        ND_PRINT("-");
        ND_PRINT("%s ",
                 tok2strary(op_code_str, "unknown (%u)", GET_U_1(hp->hsrp_op_code)));
@@ -115,7 +114,6 @@ hsrp_print(netdissect_options *ndo, const u_char *bp, u_int len)
        if (GET_U_1(hp->hsrp_reserved) != 0) {
                ND_PRINT("[reserved=%u!] ", GET_U_1(hp->hsrp_reserved));
        }
-       ND_TCHECK_4(hp->hsrp_virtaddr);
        ND_PRINT("addr=%s", GET_IPADDR_STRING(hp->hsrp_virtaddr));
        if (ndo->ndo_vflag) {
                ND_PRINT(" hellotime=");
@@ -124,14 +122,12 @@ hsrp_print(netdissect_options *ndo, const u_char *bp, u_int len)
                unsigned_relts_print(ndo, GET_U_1(hp->hsrp_holdtime));
                ND_PRINT(" priority=%u", GET_U_1(hp->hsrp_priority));
                ND_PRINT(" auth=\"");
-               if (nd_printn(ndo, hp->hsrp_authdata, sizeof(hp->hsrp_authdata),
-                             ndo->ndo_snapend)) {
-                       ND_PRINT("\"");
-                       goto trunc;
-               }
+               /*
+                * RFC 2281 Section 5.1 does not specify the encoding of
+                * Authentication Data explicitly, but zero padding can be
+                * inferred from the "recommended default value".
+                */
+               nd_printjnp(ndo, hp->hsrp_authdata, HSRP_AUTH_SIZE);
                ND_PRINT("\"");
        }
-       return;
-trunc:
-       nd_print_trunc(ndo);
 }