diff options
author | mav <mav@FreeBSD.org> | 2008-07-28 19:32:18 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2008-07-28 19:32:18 +0000 |
commit | c8ae327077d0d3c8aa97800e6353b1a9f93508fa (patch) | |
tree | 8d8455e18e2cab24492ae0c41a6bc001a1748bc5 /sys/netinet6/icmp6.c | |
parent | 3bc77fdd97f49077e9a19c9e4f98a4d4026e379a (diff) | |
download | FreeBSD-src-c8ae327077d0d3c8aa97800e6353b1a9f93508fa.zip FreeBSD-src-c8ae327077d0d3c8aa97800e6353b1a9f93508fa.tar.gz |
Move inpcb lock higher to protect some nonbinding fields reading.
It fixes nothing at this time, but decided to be more correct.
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r-- | sys/netinet6/icmp6.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index cdbc040..d71be64 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) { |