cvs commit: src/sys/netinet in.h ip_output.c ip_var.h
Bruce M Simpson
bms at spc.org
Sun May 14 07:35:27 PDT 2006
On Sun, May 14, 2006 at 02:22:49PM +0000, Bruce M Simpson wrote:
> By making the imo_membership array a dynamically allocated vector,
> this minimizes disruption to existing IPv4 multicast code. This
> change breaks the ABI for the kernel module ip_mroute.ko, and may
> cause a small amount of churn for folks working on the IGMPv3 merge.
The inpcb lock is held during re-allocation, via the use of the INP_LOCK()
macro. I believe that this is enough to cover the reallocation, based on
regression testing on my own SMP machine.
Given that realloc(9) potentially changes the address of a previously
allocated structure, locking is necessary to protect the input and output
paths from the IP_ADD_MEMBERSHIP path, to prevent a race between the
user adding a new group and a packet being demux'd from further down in
the stack for udp or raw delivery.
More information about the cvs-all