X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/abc8c2d61c65757011d9d32abb01cd1e51232f3a..383670e8f3f5b51d1017d8c1a678aa7eaf1f2b4d:/print-hsrp.c diff --git a/print-hsrp.c b/print-hsrp.c index 7c7ad218..30278268 100644 --- a/print-hsrp.c +++ b/print-hsrp.c @@ -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); }