]> The Tcpdump Group git mirrors - tcpdump/commitdiff
OLSR: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 23 Feb 2019 18:27:37 +0000 (19:27 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 23 Feb 2019 18:27:37 +0000 (19:27 +0100)
print-olsr.c

index c9ad4de5d9668dc286b195244cd29245de7c93cb..f22c82a81f2fc94b64cb012c12ac8a56d79b681c 100644 (file)
@@ -240,8 +240,7 @@ olsr_print_lq_neighbor4(netdissect_options *ndo,
     while (hello_len >= sizeof(struct olsr_lq_neighbor4)) {
 
         lq_neighbor = (const struct olsr_lq_neighbor4 *)msg_data;
-        if (!ND_TTEST_SIZE(lq_neighbor))
-            return (-1);
+        ND_TCHECK_SIZE(lq_neighbor);
 
         ND_PRINT("\n\t      neighbor %s, link-quality %.2f%%"
                ", neighbor-link-quality %.2f%%",
@@ -253,6 +252,8 @@ olsr_print_lq_neighbor4(netdissect_options *ndo,
         hello_len -= sizeof(struct olsr_lq_neighbor4);
     }
     return (0);
+trunc:
+    return -1;
 }
 
 static int
@@ -264,8 +265,7 @@ olsr_print_lq_neighbor6(netdissect_options *ndo,
     while (hello_len >= sizeof(struct olsr_lq_neighbor6)) {
 
         lq_neighbor = (const struct olsr_lq_neighbor6 *)msg_data;
-        if (!ND_TTEST_SIZE(lq_neighbor))
-            return (-1);
+        ND_TCHECK_SIZE(lq_neighbor);
 
         ND_PRINT("\n\t      neighbor %s, link-quality %.2f%%"
                ", neighbor-link-quality %.2f%%",
@@ -277,6 +277,8 @@ olsr_print_lq_neighbor6(netdissect_options *ndo,
         hello_len -= sizeof(struct olsr_lq_neighbor6);
     }
     return (0);
+trunc:
+    return -1;
 }
 
 /*
@@ -293,8 +295,7 @@ olsr_print_neighbor(netdissect_options *ndo,
 
     while (hello_len >= sizeof(nd_ipv4)) {
 
-        if (!ND_TTEST_LEN(msg_data, sizeof(nd_ipv4)))
-            return (-1);
+        ND_TCHECK_LEN(msg_data, sizeof(nd_ipv4));
         /* print 4 neighbors per line */
 
         ND_PRINT("%s%s", ipaddr_string(ndo, msg_data),
@@ -304,6 +305,8 @@ olsr_print_neighbor(netdissect_options *ndo,
         hello_len -= sizeof(nd_ipv4);
     }
     return (0);
+trunc:
+    return -1;
 }