]> The Tcpdump Group git mirrors - tcpdump/commitdiff
olsr: fix 'Advertised networks' count
authorFerry Huberts <[email protected]>
Fri, 24 Apr 2015 12:43:14 +0000 (14:43 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 3 May 2015 15:30:47 +0000 (17:30 +0200)
Signed-off-by: Ferry Huberts <[email protected]>
print-olsr.c

index 9b92a0b75458725c305a71299bc60934802467b2..de8e73202efde3c05091c62290655c9ddfc5f181 100644 (file)
@@ -495,12 +495,14 @@ olsr_print(netdissect_options *ndo,
         }
 
         case OLSR_HNA_MSG:
-            ND_PRINT((ndo, "\n\t  Advertised networks (total %u)",
-                    (unsigned int) (msg_tlen / sizeof(struct olsr_hna6))));
 #if INET6
             if (is_ipv6)
             {
                 int i = 0;
+
+                ND_PRINT((ndo, "\n\t  Advertised networks (total %u)",
+                        (unsigned int) (msg_tlen / sizeof(struct olsr_hna6))));
+
                 while (msg_tlen >= sizeof(struct olsr_hna6)) {
                     const struct olsr_hna6 *hna6;
 
@@ -520,6 +522,10 @@ olsr_print(netdissect_options *ndo,
 #endif
             {
                 int col = 0;
+
+                ND_PRINT((ndo, "\n\t  Advertised networks (total %u)",
+                        (unsigned int) (msg_tlen / sizeof(struct olsr_hna4))));
+
                 while (msg_tlen >= sizeof(struct olsr_hna4)) {
                     ND_TCHECK2(*msg_data, sizeof(struct olsr_hna4));