]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-igrp.c
ICMPv6: Delete some remains from drafts for Node Information Queries
[tcpdump] / print-igrp.c
index 91d6f8fe44ac4f9273a9bd76010e9121e3574f03..26259b46d7b167a5ca0bcdd591e26556c211563a 100644 (file)
@@ -23,9 +23,7 @@
 
 /* \summary: Interior Gateway Routing Protocol (IGRP) printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -44,7 +42,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 +119,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 {