]> The Tcpdump Group git mirrors - tcpdump/commitdiff
OLSR: Print the protocol name even if the packet is invalid
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 15 Jan 2021 13:16:18 +0000 (14:16 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 15 Jan 2021 13:19:28 +0000 (14:19 +0100)
print-olsr.c

index c3c90c42d64773afa761f156ad2bd24176deecb0..511233fe421baae85063039e6cf3c0998484d65e 100644 (file)
@@ -322,6 +322,9 @@ olsr_print(netdissect_options *ndo,
     ndo->ndo_protocol = "olsr";
     tptr = pptr;
 
+    nd_print_protocol_caps(ndo);
+    ND_PRINT("v%u", (is_ipv6) ? 6 : 4);
+
     if (length < sizeof(struct olsr_common)) {
         ND_PRINT(" (packet length < %zu)", sizeof(struct olsr_common));
         goto invalid;
@@ -330,8 +333,7 @@ olsr_print(netdissect_options *ndo,
     ptr.common = (const struct olsr_common *)tptr;
     length = ND_MIN(length, GET_BE_U_2(ptr.common->packet_len));
 
-    ND_PRINT("OLSRv%i, seq 0x%04x, length %u",
-            (is_ipv6 == 0) ? 4 : 6,
+    ND_PRINT(", seq 0x%04x, length %u",
             GET_BE_U_2(ptr.common->packet_seq),
             length);