Transitioning if_addr_lock to an rwlock

Gleb Smirnoff glebius at FreeBSD.org
Thu Dec 29 22:55:41 UTC 2011


On Thu, Dec 29, 2011 at 03:27:26PM -0500, John Baldwin wrote:
J> - if_addr_uses.patch     This changes callers of the existing macros to use
J>                          either read or write locks.  This is the patch that
J>                          could use the most review.

Reviewing your patch I've found several problems not introduced by it,
but already existing, and somewhat related to your patch:

1) Unneeded use of _SAFE version of TAILQ:

igmp.c:3338
in6.c:1339
mld6.c:2993

2) Potential race when dropping a lock inside FOREACH loop:

igmp.c:2058
mld6.c:1419
mld6.c:1704 (this one isn't even a SAFE, so would crash earlier)

3) I've found that in6_ifawithifp() doesn't do what it is supposed
to, as well as uses incorrect locking during this. As last resort
it should run through global list of addresses, not run throgh the
ifp one again. Patch attached.

-- 
Totus tuus, Glebius.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: in6.c.diff
Type: text/x-diff
Size: 2173 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20111229/a7caa7af/in6.c.bin


More information about the freebsd-net mailing list