summaryrefslogtreecommitdiff
path: root/print-olsr.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2019-02-23 19:27:37 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2019-02-23 19:27:37 +0100
commita14faa6873c8ab3cc69ba861af9d733a9c13e0df (patch)
treea7e702a1cfe8213fd28a5c5ecac509f9e9acc6df /print-olsr.c
parenta9c8816ff092f73c15a9f16ba665e158da99a1a0 (diff)
downloadtcpdump-a14faa6873c8ab3cc69ba861af9d733a9c13e0df.tar.gz
OLSR: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls
Diffstat (limited to 'print-olsr.c')
-rw-r--r--print-olsr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/print-olsr.c b/print-olsr.c
index c9ad4de5..f22c82a8 100644
--- a/print-olsr.c
+++ b/print-olsr.c
@@ -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;
}