]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-igrp.c
configure: check for gethostbyaddr(), not gethostbyname().
[tcpdump] / print-igrp.c
index 91d6f8fe44ac4f9273a9bd76010e9121e3574f03..23dc1f5688af4c48996ecefededbfdf408154210 100644 (file)
@@ -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 {