]> The Tcpdump Group git mirrors - tcpdump/commitdiff
VRRP: Print the protocol name before any GET_()
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 21 Oct 2021 14:25:57 +0000 (16:25 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 21 Oct 2021 14:40:06 +0000 (16:40 +0200)
This change will print the protocol name even if the first octet is
truncated.
Use nd_print_protocol_caps().

print-vrrp.c

index ee97974ecd438ef4b60b2fb74608889e1154af88..ef0b0768d1e2e9e0d5d3219847269e8929375092 100644 (file)
@@ -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)