diff options
author | Guy Harris <guy@alum.mit.edu> | 2020-01-19 19:55:38 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2020-01-19 19:55:38 -0800 |
commit | 306c2a0384af923a73bf234f3c8bc186ceff0b58 (patch) | |
tree | 0598390b879d6e9a76ff3b906989a920222d2654 /print-sll.c | |
parent | 2cd0a90c24ccf01ad9a034d7d5a6a651c82a4785 (diff) | |
download | tcpdump-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-sll.c')
-rw-r--r-- | print-sll.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/print-sll.c b/print-sll.c index d165da22..50335879 100644 --- a/print-sll.c +++ b/print-sll.c @@ -163,7 +163,7 @@ sll_print(netdissect_options *ndo, const struct sll_header *sllp, u_int length) * XXX - print others as strings of hex? */ if (GET_BE_U_2(sllp->sll_halen) == 6) - ND_PRINT("%s ", etheraddr_string(ndo, sllp->sll_addr)); + ND_PRINT("%s ", GET_ETHERADDR_STRING(sllp->sll_addr)); if (!ndo->ndo_qflag) { ether_type = GET_BE_U_2(sllp->sll_protocol); @@ -352,7 +352,7 @@ sll2_print(netdissect_options *ndo, const struct sll2_header *sllp, u_int length * XXX - print others as strings of hex? */ if (GET_U_1(sllp->sll2_halen) == 6) - ND_PRINT("%s ", etheraddr_string(ndo, sllp->sll2_addr)); + ND_PRINT("%s ", GET_ETHERADDR_STRING(sllp->sll2_addr)); if (!ndo->ndo_qflag) { ether_type = GET_BE_U_2(sllp->sll2_protocol); |