mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 18:14:29 +08:00
Fix warnings as "declaration of 'x' shadows a previous local"
This commit is contained in:
parent
1f056312b4
commit
b1c65c20a7
@ -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));
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user