summaryrefslogtreecommitdiff
path: root/print-mptcp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2020-01-19 19:55:38 -0800
committerGuy Harris <guy@alum.mit.edu>2020-01-19 19:55:38 -0800
commit306c2a0384af923a73bf234f3c8bc186ceff0b58 (patch)
tree0598390b879d6e9a76ff3b906989a920222d2654 /print-mptcp.c
parent2cd0a90c24ccf01ad9a034d7d5a6a651c82a4785 (diff)
downloadtcpdump-306c2a0384af923a73bf234f3c8bc186ceff0b58.tar.gz
More bounds checking when fetching addresses and converting to strings.
Replace more calls to ipaddr_string()/ip6addr_string() with calls to GET_IPADDR_STRING()/GET_IP6ADDR_STRING() macros performing bounds checking. Add similar bounds-checking inline functions and macros to wrap linkaddr_string(), etheraddr_string(), and isonsap_string() and convert calls to them to use the macros as well. Shuffle the inline functions in addrtoname.h around a bit, so that the inline functions, external declarations, and macros are all in the same order.
Diffstat (limited to 'print-mptcp.c')
-rw-r--r--print-mptcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/print-mptcp.c b/print-mptcp.c
index 0f5df402..e3a82fe6 100644
--- a/print-mptcp.c
+++ b/print-mptcp.c
@@ -341,12 +341,12 @@ add_addr_print(netdissect_options *ndo,
ND_PRINT(" id %u", GET_U_1(add_addr->addr_id));
switch (ipver) {
case 4:
- ND_PRINT(" %s", ipaddr_string(ndo, add_addr->u.v4.addr));
+ ND_PRINT(" %s", GET_IPADDR_STRING(add_addr->u.v4.addr));
if (opt_len == 10)
ND_PRINT(":%u", GET_BE_U_2(add_addr->u.v4.port));
break;
case 6:
- ND_PRINT(" %s", ip6addr_string(ndo, add_addr->u.v6.addr));
+ ND_PRINT(" %s", GET_IP6ADDR_STRING(add_addr->u.v6.addr));
if (opt_len == 22)
ND_PRINT(":%u", GET_BE_U_2(add_addr->u.v6.port));
break;