]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix warnings as "declaration of 'x' shadows a previous local"
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 12 Jul 2015 18:32:35 +0000 (20:32 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 12 Jul 2015 18:32:35 +0000 (20:32 +0200)
print-isakmp.c
print-pim.c
print-snmp.c

index d3f0eb7752d5687647ec334e6a4cc64a119da6c8..b1abcc6d21d8a309f7966cfe3e0f0b07de71516e 100644 (file)
@@ -1354,27 +1354,27 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_,
 #endif
        case 2:
            {
-               const struct ipsecdoi_id *p;
-               struct ipsecdoi_id id;
+               const struct ipsecdoi_id *doi_p;
+               struct ipsecdoi_id doi_id;
                struct protoent *pe;
 
-               p = (const struct ipsecdoi_id *)ext;
-               ND_TCHECK(*p);
-               UNALIGNED_MEMCPY(&id, ext, sizeof(id));
-               ND_PRINT((ndo," idtype=%s", STR_OR_ID(id.type, ipsecidtypestr)));
+               doi_p = (const struct ipsecdoi_id *)ext;
+               ND_TCHECK(*doi_p);
+               UNALIGNED_MEMCPY(&doi_id, ext, sizeof(doi_id));
+               ND_PRINT((ndo," idtype=%s", STR_OR_ID(doi_id.type, ipsecidtypestr)));
                /* A protocol ID of 0 DOES NOT mean IPPROTO_IP! */
-               pe = id.proto_id ? getprotobynumber(id.proto_id) : NULL;
+               pe = doi_id.proto_id ? getprotobynumber(doi_id.proto_id) : NULL;
                if (pe)
                        ND_PRINT((ndo," protoid=%s", pe->p_name));
                else
-                       ND_PRINT((ndo," protoid=%u", id.proto_id));
-               ND_PRINT((ndo," port=%d", ntohs(id.port)));
+                       ND_PRINT((ndo," protoid=%u", doi_id.proto_id));
+               ND_PRINT((ndo," port=%d", ntohs(doi_id.port)));
                if (!len)
                        break;
                if (data == NULL)
                        goto trunc;
                ND_TCHECK2(*data, len);
-               switch (id.type) {
+               switch (doi_id.type) {
                case IPSECDOI_ID_IPV4_ADDR:
                        if (len < 4)
                                ND_PRINT((ndo," len=%d [bad: < 4]", len));
index a0bf905a4e4f7ce187c8356580f709506fbd6ea0..1c1050b1dfc3b7d856881fdc6daf0d18ecc58e41 100644 (file)
@@ -787,8 +787,6 @@ pimv2_print(netdissect_options *ndo,
                                if (ndo->ndo_vflag > 1) {
                                        const u_char *ptr = bp;
                                        while (ptr < (bp+olen)) {
-                                               int advance;
-
                                                ND_PRINT((ndo, "\n\t    "));
                                                advance = pimv2_addr_print(ndo, ptr, pimv2_unicast, 0);
                                                if (advance < 0) {
index b9372644a99f394754c101aad9081eefc5a9b65f..0636a1f9928ff17491f5f476a5b9558aadba5753 100644 (file)
@@ -676,8 +676,9 @@ asn1_print(netdissect_options *ndo,
                break;
 
        case BE_OID: {
-               int o = 0, first = -1, i = asnlen;
+               int o = 0, first = -1;
 
+               i = asnlen;
                if (!ndo->ndo_sflag && !ndo->ndo_nflag && asnlen > 2) {
                        const struct obj_abrev *a = &obj_abrev_list[0];
                        size_t a_len = strlen(a->oid);
@@ -774,7 +775,8 @@ asn1_print(netdissect_options *ndo,
 
        case BE_STR: {
                register int printable = 1, first = 1;
-               const u_char *p = elem->data.str;
+
+               p = elem->data.str;
                ND_TCHECK2(*p, asnlen);
                for (i = asnlen; printable && i-- > 0; p++)
                        printable = ND_ISPRINT(*p);