From acf2e20b2472dc12ff13343f19b6ca4568847f1e Mon Sep 17 00:00:00 2001 From: dlg Date: Wed, 5 Jan 2022 05:46:18 +0000 Subject: [PATCH] fix some more -Wunused-but-set-variable --- usr.sbin/tcpdump/print-ip6opts.c | 8 +------- usr.sbin/tcpdump/print-l2tp.c | 6 +----- usr.sbin/tcpdump/print-mobile.c | 4 +--- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/usr.sbin/tcpdump/print-ip6opts.c b/usr.sbin/tcpdump/print-ip6opts.c index 8fbb0c04cc6..ec710eae78b 100644 --- a/usr.sbin/tcpdump/print-ip6opts.c +++ b/usr.sbin/tcpdump/print-ip6opts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip6opts.c,v 1.7 2020/01/24 22:46:37 procter Exp $ */ +/* $OpenBSD: print-ip6opts.c,v 1.8 2022/01/05 05:46:18 dlg Exp $ */ /* * Copyright (C) 1998 WIDE Project. @@ -107,11 +107,8 @@ int hbhopt_print(const u_char *bp) { const struct ip6_hbh *dp = (struct ip6_hbh *)bp; - const u_char *ep; int hbhlen = 0; - /* 'ep' points to the end of avaible data. */ - ep = snapend; TCHECK(dp->ip6h_len); hbhlen = (int)((dp->ip6h_len + 1) << 3); TCHECK2(*dp, hbhlen); @@ -130,11 +127,8 @@ int dstopt_print(const u_char *bp) { const struct ip6_dest *dp = (struct ip6_dest *)bp; - const u_char *ep; int dstoptlen = 0; - /* 'ep' points to the end of avaible data. */ - ep = snapend; TCHECK(dp->ip6d_len); dstoptlen = (int)((dp->ip6d_len + 1) << 3); TCHECK2(*dp, dstoptlen); diff --git a/usr.sbin/tcpdump/print-l2tp.c b/usr.sbin/tcpdump/print-l2tp.c index 67209ebefe1..c72c31e3698 100644 --- a/usr.sbin/tcpdump/print-l2tp.c +++ b/usr.sbin/tcpdump/print-l2tp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-l2tp.c,v 1.10 2018/07/06 05:47:22 dlg Exp $ */ +/* $OpenBSD: print-l2tp.c,v 1.11 2022/01/05 05:46:18 dlg Exp $ */ /* * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 @@ -618,7 +618,6 @@ l2tp_print(const u_char *dat, u_int length) u_int cnt = 0; /* total octets consumed */ u_short pad, val; int flag_t, flag_l, flag_s, flag_o, flag_p; - u_short l2tp_len; flag_t = flag_l = flag_s = flag_o = flag_p = FALSE; @@ -670,11 +669,8 @@ l2tp_print(const u_char *dat, u_int length) if (flag_l) { TCHECK2(*dat, sizeof(val)); memcpy(&val, dat, sizeof(val)); - l2tp_len = ntohs(val); dat += 2; cnt += 2; - } else { - l2tp_len = 0; } TCHECK2(*dat, sizeof(val)); diff --git a/usr.sbin/tcpdump/print-mobile.c b/usr.sbin/tcpdump/print-mobile.c index d7056f1df93..98cd5112203 100644 --- a/usr.sbin/tcpdump/print-mobile.c +++ b/usr.sbin/tcpdump/print-mobile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-mobile.c,v 1.6 2020/01/24 22:46:37 procter Exp $ */ +/* $OpenBSD: print-mobile.c,v 1.7 2022/01/05 05:46:18 dlg Exp $ */ /* $NetBSD: print-mobile.c,v 1.3 1999/07/26 06:11:57 itojun Exp $ */ /* @@ -63,7 +63,6 @@ static u_int16_t mob_in_cksum(u_short *p, int len); void mobile_print(const u_char *bp, u_int length) { - const u_char *cp = bp +8 ; const struct mobile_ip *mob; u_short proto,crc; u_char osp =0; /* old source address present */ @@ -79,7 +78,6 @@ mobile_print(const u_char *bp, u_int length) crc = EXTRACT_16BITS(&mob->hcheck); if (proto & OSRC_PRES) { osp=1; - cp +=4 ; } if (osp) { -- 2.20.1