diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2013-11-16 00:36:02 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2013-11-16 00:36:02 +0000 |
commit | 5d2377e4dc12d6196c4d8806f8a8aae07591d18c (patch) | |
tree | 3dd6e45665a4e490461e9f7d62236f75a30a16b3 | |
parent | 72d598923790359ac674a2fd8d12ee91f4639345 (diff) |
Remove dead assignments and now unused variables.
Found by LLVM/Clang Static Analyzer.
ok henning@ mikeb@ bluhm@
-rw-r--r-- | sys/net/if_pflog.c | 5 | ||||
-rw-r--r-- | sys/net/pf.c | 10 | ||||
-rw-r--r-- | sys/net/pf_norm.c | 7 |
3 files changed, 5 insertions, 17 deletions
diff --git a/sys/net/if_pflog.c b/sys/net/if_pflog.c index 5be313f307a..e5bda3371b3 100644 --- a/sys/net/if_pflog.c +++ b/sys/net/if_pflog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflog.c,v 1.57 2013/10/24 11:31:43 mpi Exp $ */ +/* $OpenBSD: if_pflog.c,v 1.58 2013/11/16 00:36:01 chl Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -310,7 +310,7 @@ pflog_bpfcopy(const void *src_arg, void *dst_arg, size_t len) struct mbuf *m, *mp, *mhdr, *mptr; struct pfloghdr *pfloghdr; u_int count; - u_char *dst, *mdst, *cp; + u_char *dst, *mdst; u_short reason; int afto, hlen, mlen, off; union pf_headers { @@ -417,7 +417,6 @@ pflog_bpfcopy(const void *src_arg, void *dst_arg, size_t len) mp = m_getptr(m, hlen, &off); if (mp != NULL) { bcopy(mp, mptr, sizeof(*mptr)); - cp = mtod(mp, char *); mptr->m_data += off; mptr->m_len -= off; mptr->m_flags &= ~M_PKTHDR; diff --git a/sys/net/pf.c b/sys/net/pf.c index 7967a6124b2..368eb03ffcb 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.860 2013/11/15 21:34:51 haesbaert Exp $ */ +/* $OpenBSD: pf.c,v 1.861 2013/11/16 00:36:01 chl Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -4527,7 +4527,7 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state, u_short *reason) { struct pf_addr *saddr = pd->src, *daddr = pd->dst; - u_int16_t *icmpsum, virtual_id, virtual_type; + u_int16_t virtual_id, virtual_type; u_int8_t icmptype; int icmp_dir, iidx, ret, multi, copyback = 0; @@ -4537,13 +4537,11 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state, #ifdef INET case IPPROTO_ICMP: icmptype = pd->hdr.icmp->icmp_type; - icmpsum = &pd->hdr.icmp->icmp_cksum; break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: icmptype = pd->hdr.icmp6->icmp6_type; - icmpsum = &pd->hdr.icmp6->icmp6_cksum; break; #endif /* INET6 */ } @@ -4686,7 +4684,6 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state, #ifdef INET6 struct ip6_hdr h2_6; #endif /* INET6 */ - u_int16_t *ipsum2; int ipoff2; /* Initialize pd2 fields valid for both packets with pd. */ @@ -4727,7 +4724,6 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state, pd2.tot_len = ntohs(h2.ip_len); pd2.src = (struct pf_addr *)&h2.ip_src; pd2.dst = (struct pf_addr *)&h2.ip_dst; - ipsum2 = &h2.ip_sum; break; #endif /* INET */ #ifdef INET6 @@ -4749,7 +4745,6 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state, sizeof(struct ip6_hdr); pd2.src = (struct pf_addr *)&h2_6.ip6_src; pd2.dst = (struct pf_addr *)&h2_6.ip6_dst; - ipsum2 = NULL; break; #endif /* INET6 */ } @@ -5800,7 +5795,6 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, "pf_route6: m0->m_len < sizeof(struct ip6_hdr)"); goto bad; } - ip6 = mtod(m0, struct ip6_hdr *); } /* diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c index 3556c9afd12..fc862ccada8 100644 --- a/sys/net/pf_norm.c +++ b/sys/net/pf_norm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_norm.c,v 1.162 2013/10/17 16:27:42 bluhm Exp $ */ +/* $OpenBSD: pf_norm.c,v 1.163 2013/11/16 00:36:01 chl Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> @@ -863,13 +863,8 @@ pf_normalize_tcp(struct pf_pdesc *pd) /* If flags changed, or reserved data set, then adjust */ if (flags != th->th_flags || th->th_x2 != 0) { - u_int16_t ov, nv; - - ov = *(u_int16_t *)(&th->th_ack + 1); th->th_flags = flags; th->th_x2 = 0; - nv = *(u_int16_t *)(&th->th_ack + 1); - rewrite = 1; } |