X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/9cfe4fc11399ff9e2e1950f30cd30addd80d4471..refs/heads/coverity_scan:/print-pim.c diff --git a/print-pim.c b/print-pim.c index cd288e8d..9241db32 100644 --- a/print-pim.c +++ b/print-pim.c @@ -21,9 +21,7 @@ /* \summary: Protocol Independent Multicast (PIM) printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -584,7 +582,6 @@ pimv2_addr_print(netdissect_options *ndo, break; default: return -1; - break; } hdrlen = 0; } @@ -599,8 +596,7 @@ pimv2_addr_print(netdissect_options *ndo, if (af == AFNUM_IP) { if (!silent) ND_PRINT("%s", GET_IPADDR_STRING(bp)); - } - else if (af == AFNUM_IP6) { + } else if (af == AFNUM_IP6) { if (!silent) ND_PRINT("%s", GET_IP6ADDR_STRING(bp)); } @@ -616,8 +612,7 @@ pimv2_addr_print(netdissect_options *ndo, if (GET_U_1(bp + 1) != 32) ND_PRINT("/%u", GET_U_1(bp + 1)); } - } - else if (af == AFNUM_IP6) { + } else if (af == AFNUM_IP6) { if (!silent) { ND_PRINT("%s", GET_IP6ADDR_STRING(bp + 2)); if (GET_U_1(bp + 1) != 128) @@ -758,7 +753,7 @@ pimv2_print(netdissect_options *ndo, case PIMV2_TYPE_HELLO: { uint16_t otype, olen; - while (len > 0) { + while (len != 0) { if (len < 4) goto trunc; otype = GET_BE_U_2(bp); @@ -815,7 +810,6 @@ pimv2_print(netdissect_options *ndo, ND_PRINT("[option length %u != 4]", olen); nd_print_invalid(ndo); return; - break; } break;