svn commit: r192612 - head/sys/netinet

Robert Watson rwatson at FreeBSD.org
Sat May 23 08:19:46 UTC 2009


On Fri, 22 May 2009, Bjoern A. Zeeb wrote:

> On Fri, 22 May 2009, Bjoern A. Zeeb wrote:
>
>> Author: bz
>> Date: Fri May 22 23:03:15 2009
>> New Revision: 192612
>> URL: http://svn.freebsd.org/changeset/base/192612
>> 
>> Log:
>>  If including vnet.h one has to include opt_route.h as well. This is
>>  because struct vnet_net holds the rt_tables[][] for MRT and array size
>>  is compile time dependent.  If you had ROUTETABLES set to >1 after
>>  r192011 V_loif was pointing into nonsense leading to strange results
>>  or even panics for some people.
>>
>>  Reviewed by:	mz
>
> Thanks to everyone who helped to debug this!

This sounds like the sort of bug that will recur easily in the future, as the 
double array based on configurable dimensions is not a very robust structure 
in C.  Is there something we can do to make this more robust?  For example, 
add assertions around consumers that appropriate includes are present in those 
consumers?  Also, given that it's a compile-time option, rt_tables should 
probably be indirected to so that there isn't an issue with modules compiled 
with different kernel options?  Especially network device drivers/modules that 
may need to use vnet and be distributed as binary ko's?

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the svn-src-head mailing list