From: Francois-Xavier Le Bail Date: Sat, 5 Feb 2022 20:43:39 +0000 (+0100) Subject: ICMPv6: Use GET_IP6ADDR_STRING() in the rpl_dio_print() function X-Git-Tag: tcpdump-4.99.2~76 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/0d05507478eeb7215ffaff64a89b90cc444ceabd ICMPv6: Use GET_IP6ADDR_STRING() in the rpl_dio_print() function Remove a redundant ND_TCHECK_SIZE(). Remove the trunc label. Remove an unnecessary variable. Fix indentation. (cherry picked from commit 4cf6bb499e72dfd0e9a551473c96890ae03879d3) --- diff --git a/print-icmp6.c b/print-icmp6.c index f16c1fa9..63c202c4 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -850,27 +850,21 @@ rpl_dio_print(netdissect_options *ndo, const u_char *bp, u_int length) { const struct nd_rpl_dio *dio = (const struct nd_rpl_dio *)bp; - const char *dagid_str; - - ND_TCHECK_SIZE(dio); - dagid_str = ip6addr_string (ndo, dio->rpl_dagid); ND_PRINT(" [dagid:%s,seq:%u,instance:%u,rank:%u,%smop:%s,prf:%u]", - dagid_str, + GET_IP6ADDR_STRING(dio->rpl_dagid), GET_U_1(dio->rpl_dtsn), GET_U_1(dio->rpl_instanceid), GET_BE_U_2(dio->rpl_dagrank), RPL_DIO_GROUNDED(GET_U_1(dio->rpl_mopprf)) ? "grounded,":"", - tok2str(rpl_mop_values, "mop%u", RPL_DIO_MOP(GET_U_1(dio->rpl_mopprf))), + tok2str(rpl_mop_values, "mop%u", + RPL_DIO_MOP(GET_U_1(dio->rpl_mopprf))), RPL_DIO_PRF(GET_U_1(dio->rpl_mopprf))); if(ndo->ndo_vflag > 1) { rpl_printopts(ndo, bp + sizeof(struct nd_rpl_dio), length - sizeof(struct nd_rpl_dio)); } - return; -trunc: - nd_print_trunc(ndo); } static void