From: Francois-Xavier Le Bail Date: Thu, 21 Oct 2021 14:25:57 +0000 (+0200) Subject: VRRP: Print the protocol name before any GET_() X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/c855567d0959821d5e33c931fbd6fde67c34becc VRRP: Print the protocol name before any GET_() This change will print the protocol name even if the first octet is truncated. Use nd_print_protocol_caps(). --- diff --git a/print-vrrp.c b/print-vrrp.c index ee97974e..ef0b0768 100644 --- a/print-vrrp.c +++ b/print-vrrp.c @@ -111,10 +111,11 @@ vrrp_print(netdissect_options *ndo, const char *type_s; ndo->ndo_protocol = "vrrp"; + nd_print_protocol_caps(ndo); version = (GET_U_1(bp) & 0xf0) >> 4; type = GET_U_1(bp) & 0x0f; type_s = tok2str(type2str, "unknown type (%u)", type); - ND_PRINT("VRRPv%u, %s", version, type_s); + ND_PRINT("v%u, %s", version, type_s); if (ttl != 255) ND_PRINT(", (ttl %u)", ttl); if (version < 2 || version > 3 || type != VRRP_TYPE_ADVERTISEMENT)