summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--print-esp.c7
-rw-r--r--print-icmp6.c5
-rw-r--r--print-pgm.c50
-rw-r--r--print-pim.c4
4 files changed, 18 insertions, 48 deletions
diff --git a/print-esp.c b/print-esp.c
index 2c143cd6..407fdb36 100644
--- a/print-esp.c
+++ b/print-esp.c
@@ -225,7 +225,6 @@ static int
espprint_decode_encalgo(netdissect_options *ndo,
char *decode, struct sa_list *sa)
{
- int len;
size_t i;
const EVP_CIPHER *evp;
int authlen = 0;
@@ -238,7 +237,6 @@ espprint_decode_encalgo(netdissect_options *ndo,
}
*colon = '\0';
- len = colon - decode;
if (strlen(decode) > strlen("-hmac96") &&
!strcmp(decode + strlen(decode) - strlen("-hmac96"),
"-hmac96")) {
@@ -550,7 +548,6 @@ esp_print(netdissect_options *ndo,
#ifdef HAVE_LIBCRYPTO
struct ip *ip;
struct sa_list *sa = NULL;
- int espsecret_keylen;
#ifdef INET6
struct ip6_hdr *ip6 = NULL;
#endif
@@ -561,7 +558,6 @@ esp_print(netdissect_options *ndo,
u_char *ivoff;
u_char *p;
EVP_CIPHER_CTX ctx;
- int blocksz;
#endif
esp = (struct newesp *)bp;
@@ -665,7 +661,6 @@ esp_print(netdissect_options *ndo,
ivoff = (u_char *)(esp + 1) + 0;
ivlen = sa->ivlen;
secret = sa->secret;
- espsecret_keylen = sa->secretlen;
ep = ep - sa->authlen;
if (sa->evp) {
@@ -673,8 +668,6 @@ esp_print(netdissect_options *ndo,
if (EVP_CipherInit(&ctx, sa->evp, secret, NULL, 0) < 0)
(*ndo->ndo_warning)(ndo, "espkey init failed");
- blocksz = EVP_CIPHER_CTX_block_size(&ctx);
-
p = ivoff;
EVP_CipherInit(&ctx, NULL, NULL, p, 0);
EVP_Cipher(&ctx, p + ivlen, p + ivlen, ep - (p + ivlen));
diff --git a/print-icmp6.c b/print-icmp6.c
index 0b38c43e..811e5a06 100644
--- a/print-icmp6.c
+++ b/print-icmp6.c
@@ -669,9 +669,7 @@ static void
icmp6_opt_print(const u_char *bp, int resid)
{
const struct nd_opt_hdr *op;
- const struct nd_opt_hdr *opl; /* why there's no struct? */
const struct nd_opt_prefix_info *opp;
- const struct icmp6_opts_redirect *opr;
const struct nd_opt_mtu *opm;
const struct nd_opt_rdnss *oprd;
const struct nd_opt_dnssl *opds;
@@ -708,12 +706,10 @@ icmp6_opt_print(const u_char *bp, int resid)
switch (op->nd_opt_type) {
case ND_OPT_SOURCE_LINKADDR:
- opl = (struct nd_opt_hdr *)op;
l = (op->nd_opt_len << 3) - 2;
print_lladdr(cp + 2, l);
break;
case ND_OPT_TARGET_LINKADDR:
- opl = (struct nd_opt_hdr *)op;
l = (op->nd_opt_len << 3) - 2;
print_lladdr(cp + 2, l);
break;
@@ -729,7 +725,6 @@ icmp6_opt_print(const u_char *bp, int resid)
printf(", pref. time %s", get_lifetime(EXTRACT_32BITS(&opp->nd_opt_pi_preferred_time)));
break;
case ND_OPT_REDIRECTED_HEADER:
- opr = (struct icmp6_opts_redirect *)op;
print_unknown_data(bp,"\n\t ",op->nd_opt_len<<3);
/* xxx */
break;
diff --git a/print-pgm.c b/print-pgm.c
index 72c80d9a..b6138c6f 100644
--- a/print-pgm.c
+++ b/print-pgm.c
@@ -171,7 +171,7 @@ pgm_print(register const u_char *bp, register u_int length,
#else
char nla_buf[INET_ADDRSTRLEN];
#endif
- u_int8_t opt_type, opt_len, flags1, flags2;
+ u_int8_t opt_type, opt_len;
u_int32_t seq, opts_len, len, offset;
pgm = (struct pgm_header *)bp;
@@ -542,8 +542,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_FRAGMENT option, length %u != 16]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
offset = EXTRACT_32BITS(bp);
@@ -555,8 +554,7 @@ pgm_print(register const u_char *bp, register u_int length,
break;
case PGM_OPT_NAK_LIST:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
opt_len -= sizeof(u_int32_t); /* option header */
(void)printf(" NAK LIST");
while (opt_len) {
@@ -577,8 +575,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_JOIN option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" JOIN %u", seq);
@@ -590,8 +587,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_NAK_BO_IVL option, length %u != 12]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
seq = EXTRACT_32BITS(bp);
@@ -605,8 +601,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_NAK_BO_RNG option, length %u != 12]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
seq = EXTRACT_32BITS(bp);
@@ -616,8 +611,7 @@ pgm_print(register const u_char *bp, register u_int length,
break;
case PGM_OPT_REDIRECT:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
switch (EXTRACT_16BITS(bp)) {
case AFI_IP:
addr_size = sizeof(struct in_addr);
@@ -652,8 +646,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_PARITY_PRM option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
len = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" PARITY MAXTGS %u", len);
@@ -665,8 +658,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_PARITY_GRP option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" PARITY GROUP %u", seq);
@@ -678,8 +670,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_CURR_TGSIZE option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
len = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" PARITY ATGS %u", len);
@@ -691,8 +682,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_NBR_UNREACH option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" NBR_UNREACH");
opts_len -= 4;
break;
@@ -708,8 +698,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_SYN option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" SYN");
opts_len -= 4;
break;
@@ -719,8 +708,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_FIN option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" FIN");
opts_len -= 4;
break;
@@ -730,8 +718,7 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_RST option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" RST");
opts_len -= 4;
break;
@@ -747,15 +734,13 @@ pgm_print(register const u_char *bp, register u_int length,
(void)printf("[Bad OPT_CRQST option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" CRQST");
opts_len -= 4;
break;
case PGM_OPT_PGMCC_DATA:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
switch (EXTRACT_16BITS(bp)) {
@@ -788,8 +773,7 @@ pgm_print(register const u_char *bp, register u_int length,
break;
case PGM_OPT_PGMCC_FEEDBACK:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
switch (EXTRACT_16BITS(bp)) {
diff --git a/print-pim.c b/print-pim.c
index 3cd68109..71360836 100644
--- a/print-pim.c
+++ b/print-pim.c
@@ -121,7 +121,7 @@ static void pimv2_print(register const u_char *bp, register u_int len, u_int cks
static void
pimv1_join_prune_print(register const u_char *bp, register u_int len)
{
- int maddrlen, addrlen, ngroups, njoin, nprune;
+ int ngroups, njoin, nprune;
int njp;
/* If it's a single group and a single source, use 1-line output. */
@@ -162,8 +162,6 @@ pimv1_join_prune_print(register const u_char *bp, register u_int len)
len -= 8;
TCHECK2(bp[0], 4);
- maddrlen = bp[1];
- addrlen = bp[2];
ngroups = bp[3];
bp += 4;
len -= 4;