aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2008-07-28 19:32:18 +0000
committerAlexander Motin <mav@FreeBSD.org>2008-07-28 19:32:18 +0000
commit6c5bbf5ce1d6814f1281c4687957549b713c6f43 (patch)
tree8d8455e18e2cab24492ae0c41a6bc001a1748bc5 /sys/netinet6/icmp6.c
parent2e3838552652a5dbb8a6ca0d5b25799f8e90dd98 (diff)
downloadsrc-6c5bbf5ce1d6814f1281c4687957549b713c6f43.tar.gz
src-6c5bbf5ce1d6814f1281c4687957549b713c6f43.zip
Move inpcb lock higher to protect some nonbinding fields reading.
It fixes nothing at this time, but decided to be more correct.
Notes
Notes: svn path=/head/; revision=180932
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index cdbc040299fa..d71be64dfc08 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1907,10 +1907,13 @@ icmp6_rip6_input(struct mbuf **mp, int off)
if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr) &&
!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))
+ in6p->in6p_icmp6filt)) {
+ INP_RUNLOCK(in6p);
continue;
+ }
if (last) {
struct mbuf *n = NULL;
@@ -1970,7 +1973,6 @@ icmp6_rip6_input(struct mbuf **mp, int off)
INP_RUNLOCK(last);
}
last = in6p;
- INP_RLOCK(last);
}
INP_INFO_RUNLOCK(&ripcbinfo);
if (last) {