Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/tcpdump/dist remove unused variables
details: https://anonhg.NetBSD.org/src/rev/f714654073cf
branches: trunk
changeset: 790746:f714654073cf
user: christos <christos%NetBSD.org@localhost>
date: Sun Oct 20 02:58:34 2013 +0000
description:
remove unused variables
diffstat:
external/bsd/tcpdump/dist/print-esp.c | 9 +----
external/bsd/tcpdump/dist/print-icmp6.c | 7 +---
external/bsd/tcpdump/dist/print-isakmp.c | 13 +-------
external/bsd/tcpdump/dist/print-pgm.c | 52 +++++++++++--------------------
external/bsd/tcpdump/dist/print-pim.c | 6 ++-
external/bsd/tcpdump/dist/print-sctp.c | 6 +---
6 files changed, 27 insertions(+), 66 deletions(-)
diffs (truncated from 422 to 300 lines):
diff -r 41136fed5130 -r f714654073cf external/bsd/tcpdump/dist/print-esp.c
--- a/external/bsd/tcpdump/dist/print-esp.c Sun Oct 20 02:58:24 2013 +0000
+++ b/external/bsd/tcpdump/dist/print-esp.c Sun Oct 20 02:58:34 2013 +0000
@@ -27,7 +27,7 @@
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-esp.c,v 1.58 2007-12-07 00:03:07 mcr Exp (LBL)";
#else
-__RCSID("$NetBSD: print-esp.c,v 1.3 2013/04/06 19:33:08 christos Exp $");
+__RCSID("$NetBSD: print-esp.c,v 1.4 2013/10/20 02:58:34 christos Exp $");
#endif
#endif
@@ -221,7 +221,6 @@
espprint_decode_encalgo(netdissect_options *ndo,
char *decode, struct sa_list *sa)
{
- int len;
size_t i;
const EVP_CIPHER *evp;
int authlen = 0;
@@ -234,7 +233,6 @@
}
*colon = '\0';
- len = colon - decode;
if (strlen(decode) > strlen("-hmac96") &&
!strcmp(decode + strlen(decode) - strlen("-hmac96"),
"-hmac96")) {
@@ -540,7 +538,6 @@
#ifdef HAVE_LIBCRYPTO
struct ip *ip;
struct sa_list *sa = NULL;
- int espsecret_keylen;
#ifdef INET6
struct ip6_hdr *ip6 = NULL;
#endif
@@ -551,7 +548,6 @@
u_char *ivoff;
u_char *p;
EVP_CIPHER_CTX ctx;
- int blocksz;
#endif
esp = (struct newesp *)bp;
@@ -655,7 +651,6 @@
ivoff = (u_char *)(esp + 1) + 0;
ivlen = sa->ivlen;
secret = sa->secret;
- espsecret_keylen = sa->secretlen;
ep = ep - sa->authlen;
if (sa->evp) {
@@ -663,7 +658,7 @@
if (EVP_CipherInit(&ctx, sa->evp, secret, NULL, 0) < 0)
(*ndo->ndo_warning)(ndo, "espkey init failed");
- blocksz = EVP_CIPHER_CTX_block_size(&ctx);
+ (void)EVP_CIPHER_CTX_block_size(&ctx);
p = ivoff;
EVP_CipherInit(&ctx, NULL, NULL, p, 0);
diff -r 41136fed5130 -r f714654073cf external/bsd/tcpdump/dist/print-icmp6.c
--- a/external/bsd/tcpdump/dist/print-icmp6.c Sun Oct 20 02:58:24 2013 +0000
+++ b/external/bsd/tcpdump/dist/print-icmp6.c Sun Oct 20 02:58:34 2013 +0000
@@ -25,7 +25,7 @@
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.86 2008-02-05 19:36:13 guy Exp ";
#else
-__RCSID("$NetBSD: print-icmp6.c,v 1.4 2013/04/06 19:33:08 christos Exp $");
+__RCSID("$NetBSD: print-icmp6.c,v 1.5 2013/10/20 02:58:34 christos Exp $");
#endif
#endif
@@ -679,9 +679,7 @@
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_advinterval *opa;
@@ -717,12 +715,10 @@
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;
@@ -738,7 +734,6 @@
printf(", pref. time %ss", 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 -r 41136fed5130 -r f714654073cf external/bsd/tcpdump/dist/print-isakmp.c
--- a/external/bsd/tcpdump/dist/print-isakmp.c Sun Oct 20 02:58:24 2013 +0000
+++ b/external/bsd/tcpdump/dist/print-isakmp.c Sun Oct 20 02:58:34 2013 +0000
@@ -34,7 +34,7 @@
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.61 2008-02-05 19:34:25 guy Exp (LBL)";
#else
-__RCSID("$NetBSD: print-isakmp.c,v 1.4 2013/04/06 19:33:08 christos Exp $");
+__RCSID("$NetBSD: print-isakmp.c,v 1.5 2013/10/20 02:58:34 christos Exp $");
#endif
#endif
@@ -550,7 +550,6 @@
{
const struct ikev1_pl_sa *p;
struct ikev1_pl_sa sa;
- const u_int32_t *q;
u_int32_t doi, sit, ident;
const u_char *cp, *np;
int t;
@@ -569,7 +568,6 @@
}
ND_PRINT((ndo," doi=ipsec"));
- q = (u_int32_t *)&sa.sit;
ND_PRINT((ndo," situation="));
t = 0;
if (sit & 0x01) {
@@ -1773,7 +1771,6 @@
{
struct ikev2_n *p, n;
const u_char *cp;
- u_char *ep2;
u_char showspi, showdata, showsomedata;
const char *notify_name;
u_int32_t type;
@@ -1950,7 +1947,6 @@
}
cp = (u_char *)(p + 1) + n.spi_size;
- ep2 = (u_char *)p + item_len;
if(3 < ndo->ndo_vflag) {
showdata = 1;
@@ -2267,7 +2263,6 @@
if (ndo->ndo_vflag) {
const struct isakmp_gen *ext;
- int nparen;
ND_PRINT((ndo,":"));
@@ -2281,7 +2276,6 @@
goto done;
}
- nparen = 0;
CHECKLEN(p + 1, base->np);
np = base->np;
ext = (struct isakmp_gen *)(p + 1);
@@ -2424,7 +2418,6 @@
if (ndo->ndo_vflag) {
const struct isakmp_gen *ext;
- int nparen;
ND_PRINT((ndo, ":"));
@@ -2438,7 +2431,6 @@
goto done;
}
- nparen = 0;
CHECKLEN(p + 1, base->np)
np = base->np;
@@ -2522,9 +2514,6 @@
const u_char *bp, u_int length,
const u_char *bp2)
{
- const u_char *ep;
- ep = ndo->ndo_snapend;
-
if(length == 1 && bp[0]==0xff) {
ND_PRINT((ndo, "isakmp-nat-keep-alive"));
return;
diff -r 41136fed5130 -r f714654073cf external/bsd/tcpdump/dist/print-pgm.c
--- a/external/bsd/tcpdump/dist/print-pgm.c Sun Oct 20 02:58:24 2013 +0000
+++ b/external/bsd/tcpdump/dist/print-pgm.c Sun Oct 20 02:58:34 2013 +0000
@@ -19,7 +19,7 @@
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-pgm.c,v 1.5 2005-06-07 22:05:58 guy Exp ";
#else
-__RCSID("$NetBSD: print-pgm.c,v 1.3 2013/04/06 19:33:08 christos Exp $");
+__RCSID("$NetBSD: print-pgm.c,v 1.4 2013/10/20 02:58:34 christos Exp $");
#endif
#endif
@@ -176,7 +176,7 @@
#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;
@@ -550,8 +550,7 @@
(void)printf("[Bad OPT_FRAGMENT option, length %u != 16]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
offset = EXTRACT_32BITS(bp);
@@ -563,8 +562,7 @@
break;
case PGM_OPT_NAK_LIST:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
opt_len -= sizeof(u_int32_t); /* option header */
(void)printf(" NAK LIST");
while (opt_len) {
@@ -585,8 +583,7 @@
(void)printf("[Bad OPT_JOIN option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" JOIN %u", seq);
@@ -598,8 +595,7 @@
(void)printf("[Bad OPT_NAK_BO_IVL option, length %u != 12]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
seq = EXTRACT_32BITS(bp);
@@ -613,8 +609,7 @@
(void)printf("[Bad OPT_NAK_BO_RNG option, length %u != 12]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
seq = EXTRACT_32BITS(bp);
@@ -624,8 +619,7 @@
break;
case PGM_OPT_REDIRECT:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
switch (EXTRACT_16BITS(bp)) {
case AFI_IP:
addr_size = sizeof(struct in_addr);
@@ -660,8 +654,7 @@
(void)printf("[Bad OPT_PARITY_PRM option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
len = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" PARITY MAXTGS %u", len);
@@ -673,8 +666,7 @@
(void)printf("[Bad OPT_PARITY_GRP option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" PARITY GROUP %u", seq);
@@ -686,8 +678,7 @@
(void)printf("[Bad OPT_CURR_TGSIZE option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2; /* skip flags */
len = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
Home |
Main Index |
Thread Index |
Old Index