diff options
author | rwatson <rwatson@FreeBSD.org> | 2008-07-29 18:09:46 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2008-07-29 18:09:46 +0000 |
commit | cd641465efc39b57509f1b8804848c55ba1b4738 (patch) | |
tree | 371d8edef6b300b98f1fc80a5d8bcb8ff8fd6879 /sys/netinet6 | |
parent | 1021fb07ded976dc03c797ff87f9dc69a52cb7f8 (diff) | |
download | FreeBSD-src-cd641465efc39b57509f1b8804848c55ba1b4738.zip FreeBSD-src-cd641465efc39b57509f1b8804848c55ba1b4738.tar.gz |
Since we fail IPv6 raw socket allocation if inp->in6p_icmp6filt can't
be allocated, there's no need to conditionize use and freeing of it
later.
MFC after: 1 week
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/icmp6.c | 13 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 5 |
2 files changed, 3 insertions, 15 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index d71be64..3fdff60 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1908,9 +1908,8 @@ icmp6_rip6_input(struct mbuf **mp, int off) !IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, &ip6->ip6_src)) continue; INP_RLOCK(in6p); - if (in6p->in6p_icmp6filt - && ICMP6_FILTER_WILLBLOCK(icmp6->icmp6_type, - in6p->in6p_icmp6filt)) { + if (ICMP6_FILTER_WILLBLOCK(icmp6->icmp6_type, + in6p->in6p_icmp6filt)) { INP_RUNLOCK(in6p); continue; } @@ -2722,10 +2721,6 @@ icmp6_ctloutput(struct socket *so, struct sockopt *sopt) error = EMSGSIZE; break; } - if (inp->in6p_icmp6filt == NULL) { - error = EINVAL; - break; - } error = sooptcopyin(sopt, inp->in6p_icmp6filt, optlen, optlen); break; @@ -2741,10 +2736,6 @@ icmp6_ctloutput(struct socket *so, struct sockopt *sopt) switch (optname) { case ICMP6_FILTER: { - if (inp->in6p_icmp6filt == NULL) { - error = EINVAL; - break; - } error = sooptcopyout(sopt, inp->in6p_icmp6filt, sizeof(struct icmp6_filter)); break; diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index a9f5bd2..4f02f32 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -592,10 +592,7 @@ rip6_detach(struct socket *so) /* xxx: RSVP */ INP_INFO_WLOCK(&ripcbinfo); INP_WLOCK(inp); - if (inp->in6p_icmp6filt) { - FREE(inp->in6p_icmp6filt, M_PCB); - inp->in6p_icmp6filt = NULL; - } + FREE(inp->in6p_icmp6filt, M_PCB); in6_pcbdetach(inp); in6_pcbfree(inp); INP_INFO_WUNLOCK(&ripcbinfo); |