X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/d17c56a6f65369c5b406d77a6cf039cc40b49ff4..refs/pull/433/head:/print-pim.c diff --git a/print-pim.c b/print-pim.c index 9fc94394..15f4c513 100644 --- a/print-pim.c +++ b/print-pim.c @@ -121,7 +121,7 @@ static const struct tok pimv2_register_flag_values[] = { */ struct pim { - u_int8_t pim_typever; + uint8_t pim_typever; /* upper 4bit: PIM version number; 2 for PIMv2 */ /* lower 4bit: the PIM message type, currently they are: * Hello, Register, Register-Stop, Join/Prune, @@ -648,7 +648,7 @@ pimv2_print(netdissect_options *ndo, switch (PIM_TYPE(pim->pim_typever)) { case PIMV2_TYPE_HELLO: { - u_int16_t otype, olen; + uint16_t otype, olen; bp += 4; while (bp < ep) { ND_TCHECK2(bp[0], 4); @@ -671,7 +671,7 @@ pimv2_print(netdissect_options *ndo, ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen)); } else { char t_bit; - u_int16_t lan_delay, override_interval; + uint16_t lan_delay, override_interval; lan_delay = EXTRACT_16BITS(bp); override_interval = EXTRACT_16BITS(bp+2); t_bit = (lan_delay & 0x8000)? 1 : 0; @@ -748,8 +748,7 @@ pimv2_print(netdissect_options *ndo, { struct ip *ip; - if (!ND_TTEST2(*(bp+4), PIMV2_REGISTER_FLAG_LEN)) - goto trunc; + ND_TCHECK2(*(bp + 4), PIMV2_REGISTER_FLAG_LEN); ND_PRINT((ndo, ", Flags [ %s ]\n\t", tok2str(pimv2_register_flag_values, @@ -769,11 +768,11 @@ pimv2_print(netdissect_options *ndo, case 4: /* IPv4 */ ip_print(ndo, bp, len); break; -#ifdef INET6 + case 6: /* IPv6 */ ip6_print(ndo, bp, len); break; -#endif + default: ND_PRINT((ndo, "IP ver %d", IP_V(ip))); break; @@ -842,10 +841,10 @@ pimv2_print(netdissect_options *ndo, */ { - u_int8_t ngroup; - u_int16_t holdtime; - u_int16_t njoin; - u_int16_t nprune; + uint8_t ngroup; + uint16_t holdtime; + uint16_t njoin; + uint16_t nprune; int i, j; bp += 4; len -= 4; @@ -916,9 +915,9 @@ pimv2_print(netdissect_options *ndo, bp += 4; /* Fragment Tag, Hash Mask len, and BSR-priority */ - if (bp + sizeof(u_int16_t) >= ep) break; + if (bp + sizeof(uint16_t) >= ep) break; ND_PRINT((ndo, " tag=%x", EXTRACT_16BITS(bp))); - bp += sizeof(u_int16_t); + bp += sizeof(uint16_t); if (bp >= ep) break; ND_PRINT((ndo, " hashmlen=%d", bp[0])); if (bp + 1 >= ep) break;