Skip to content

Commit f4a7688

Browse files
committed
CARP: 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().
1 parent a57e329 commit f4a7688

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

print-carp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ carp_print(netdissect_options *ndo, const u_char *bp, u_int len, u_int ttl)
5252
const char *type_s;
5353

5454
ndo->ndo_protocol = "carp";
55+
nd_print_protocol_caps(ndo);
5556
version = (GET_U_1(bp) & 0xf0) >> 4;
5657
type = GET_U_1(bp) & 0x0f;
5758
if (type == 1)
5859
type_s = "advertise";
5960
else
6061
type_s = "unknown";
61-
ND_PRINT("CARPv%u-%s %u: ", version, type_s, len);
62+
ND_PRINT("v%u-%s %u: ", version, type_s, len);
6263
if (ttl != 255)
6364
ND_PRINT("[ttl=%u!] ", ttl);
6465
if (version != 2 || type != 1)

0 commit comments

Comments
 (0)