X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/09b9aad3913e55acf0970f31fbc940c71d3b713c..399c9c7a72b711ca63f2e2bcc07abfe994906aaa:/print-igrp.c diff --git a/print-igrp.c b/print-igrp.c index 91d6f8fe..23dc1f56 100644 --- a/print-igrp.c +++ b/print-igrp.c @@ -44,7 +44,7 @@ struct igrphdr { nd_uint16_t ig_as; /* autonomous system number */ nd_uint16_t ig_ni; /* number of subnet in local net */ nd_uint16_t ig_ns; /* number of networks in AS */ - nd_uint16_t ig_nx; /* number of networks ouside AS */ + nd_uint16_t ig_nx; /* number of networks outside AS */ nd_uint16_t ig_sum; /* checksum of IGRP header & data */ }; @@ -121,16 +121,20 @@ igrp_print(netdissect_options *ndo, const u_char *bp, u_int length) length -= sizeof(*hdr); while (length >= IGRP_RTE_SIZE) { const struct igrprte *igr = (const struct igrprte *)cp; + uint8_t net0 = GET_U_1(&igr->igr_net[0]); + uint8_t net1 = GET_U_1(&igr->igr_net[1]); + uint8_t net2 = GET_U_1(&igr->igr_net[2]); + if (nint > 0) { - ND_PRINT(" *.%u.%u.%u", igr->igr_net[0], igr->igr_net[1], igr->igr_net[2]); + ND_PRINT(" *.%u.%u.%u", net0, net1, net2); igrp_entry_print(ndo, igr); --nint; } else if (nsys > 0) { - ND_PRINT(" %u.%u.%u.0", igr->igr_net[0], igr->igr_net[1], igr->igr_net[2]); + ND_PRINT(" %u.%u.%u.0", net0, net1, net2); igrp_entry_print(ndo, igr); --nsys; } else if (next > 0) { - ND_PRINT(" X%u.%u.%u.0", igr->igr_net[0], igr->igr_net[1], igr->igr_net[2]); + ND_PRINT(" X%u.%u.%u.0", net0, net1, net2); igrp_entry_print(ndo, igr); --next; } else {