Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 May 2006 15:35:22 +0100
From:      Bruce M Simpson <bms@spc.org>
To:        Bruce M Simpson <bms@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netinet in.h ip_output.c ip_var.h
Message-ID:  <20060514143522.GF46921@spc.org>
In-Reply-To: <200605141422.k4EEMnmC056704@repoman.freebsd.org>
References:  <200605141422.k4EEMnmC056704@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

Regards,
BMS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060514143522.GF46921>