diff options
author | bms <bms@FreeBSD.org> | 2009-05-01 11:05:24 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2009-05-01 11:05:24 +0000 |
commit | 0c2462747fbc4d0912deb7c49d3336d1791ccbd4 (patch) | |
tree | 3deed13daa52f6d56de13677a99cffa45b8098bb | |
parent | e3041466988f968760de57959e5fd6674a0acf66 (diff) | |
download | FreeBSD-src-0c2462747fbc4d0912deb7c49d3336d1791ccbd4.zip FreeBSD-src-0c2462747fbc4d0912deb7c49d3336d1791ccbd4.tar.gz |
Limit scope of acquisition of INP_RLOCK for multicast input filter
to the scope of its use, even though this may thrash the lock if
the INP is referenced for other purposes.
Tested by: David Wolfskill
-rw-r--r-- | sys/netinet6/udp6_usrreq.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 5393740..19cca2c 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -279,8 +279,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto) continue; } - INP_RLOCK(inp); - /* * Handle socket delivery policy for any-source * and source-specific multicast. [RFC3678] @@ -290,6 +288,8 @@ udp6_input(struct mbuf **mp, int *offp, int proto) struct sockaddr_in6 mcaddr; int blocked; + INP_RLOCK(inp); + bzero(&mcaddr, sizeof(struct sockaddr_in6)); mcaddr.sin6_len = sizeof(struct sockaddr_in6); mcaddr.sin6_family = AF_INET6; @@ -304,9 +304,11 @@ udp6_input(struct mbuf **mp, int *offp, int proto) if (blocked == MCAST_NOTSMEMBER || blocked == MCAST_MUTED) UDPSTAT_INC(udps_filtermcast); - INP_RUNLOCK(inp); + INP_RUNLOCK(inp); /* XXX */ continue; } + + INP_RUNLOCK(inp); } if (last != NULL) { struct mbuf *n; @@ -423,8 +425,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto) return (IPPROTO_DONE); badheadlocked: - if (inp) - INP_RUNLOCK(inp); INP_INFO_RUNLOCK(&V_udbinfo); badunlocked: if (m) |