X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7885cfa165458a05ef818c34ee03affc79f03725..c39d40a767a1ae36171e5bcbf6f157ff3e80fb6c:/print-vrrp.c diff --git a/print-vrrp.c b/print-vrrp.c index 2739e37c..ee97974e 100644 --- a/print-vrrp.c +++ b/print-vrrp.c @@ -111,7 +111,6 @@ vrrp_print(netdissect_options *ndo, const char *type_s; ndo->ndo_protocol = "vrrp"; - ND_TCHECK_1(bp); version = (GET_U_1(bp) & 0xf0) >> 4; type = GET_U_1(bp) & 0x0f; type_s = tok2str(type2str, "unknown type (%u)", type); @@ -120,9 +119,7 @@ vrrp_print(netdissect_options *ndo, ND_PRINT(", (ttl %u)", ttl); if (version < 2 || version > 3 || type != VRRP_TYPE_ADVERTISEMENT) return; - ND_TCHECK_1(bp + 2); ND_PRINT(", vrid %u, prio %u", GET_U_1(bp + 1), GET_U_1(bp + 2)); - ND_TCHECK_1(bp + 5); if (version == 2) { auth_type = GET_U_1(bp + 4); @@ -163,22 +160,18 @@ vrrp_print(netdissect_options *ndo, c = ' '; bp += 8; for (i = 0; i < naddrs; i++) { - ND_TCHECK_1(bp + 3); ND_PRINT("%c%s", c, GET_IPADDR_STRING(bp)); c = ','; bp += 4; } if (version == 2 && auth_type == VRRP_AUTH_SIMPLE) { /* simple text password */ - ND_TCHECK_1(bp + 7); ND_PRINT(" auth \""); - if (nd_printn(ndo, bp, 8, ndo->ndo_snapend)) { - ND_PRINT("\""); - goto trunc; - } + /* + * RFC 2338 Section 5.3.10: "If the configured authentication string + * is shorter than 8 bytes, the remaining space MUST be zero-filled. + */ + nd_printjnp(ndo, bp, 8); ND_PRINT("\""); } } - return; -trunc: - nd_print_trunc(ndo); }