Small patch to multicast code...

Robert Watson rwatson at FreeBSD.org
Sat Aug 30 09:59:31 UTC 2008


On Fri, 29 Aug 2008, Sam Leffler wrote:

>> The bridge code does a deep copy of the packet for each interface it 
>> broadcasts on due the firewall code modifying the headers. It sounds like 
>> this should just be a copy+pullup instead.
>
> I'd not do that.  I think there are paths that assume the deep copy.  Right 
> now the network code is very poor honoring read-only-ness of mbuf chains. 
> To get this right we need to do a good audit.  I know I hit issues when 
> doing some tricks w/ marking rx buffers read-only to avoid cache flushes. 
> netbsd trys to be more pedantic but still has problems too.

This strikes me as an extremely tricky thing to get right as bugs manifest in 
very subtle ways.  The IP output path makes lots of assumptions about being 
able to continue to write to outgoing headers for the purposes of deferred 
checksum calculation, NAT, IPSEC, fragmentation, encapsulation, etc.  IP 
multicast loopback is just one of the rare edge cases where, if exercised, we 
currently deterministically discover this, but presumably there's more to come 
as parallelism continues to increase.

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-net mailing list