Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Nov 2014 03:09:07 +0300
From:      "Alexander V. Chernikov" <melifaro@ipfw.ru>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-projects@freebsd.org, src-committers@freebsd.org, "Alexander V. Chernikov" <melifaro@freebsd.org>
Subject:   Re: svn commit: r274256 - in projects/routing/sys: net netinet netinet6 netpfil/pf
Message-ID:  <D04D87A8-801B-482C-9D76-18B82FD8EA0E@ipfw.ru>
In-Reply-To: <20141108104426.X2034@besplex.bde.org>
References:  <201411072252.sA7Mq3u6006585@svn.freebsd.org> <20141108104426.X2034@besplex.bde.org>

index | next in thread | previous in thread | raw e-mail


> On 08 Nov 2014, at 02:49, Bruce Evans <brde@optusnet.com.au> wrote:
> 
> On Fri, 7 Nov 2014, Alexander V. Chernikov wrote:
> 
>> Log:
>> Split radix implementation and system route table structure:
>> use new 'struct radix_head' for radix.
> 
>> Modified: projects/routing/sys/net/radix.c
>> ==============================================================================
>> --- projects/routing/sys/net/radix.c	Fri Nov  7 22:02:44 2014	(r274255)
>> +++ projects/routing/sys/net/radix.c	Fri Nov  7 22:52:02 2014	(r274256)
>> ...
>> @@ -1132,13 +1134,13 @@ rn_inithead_internal(void **head, int of
>> 	tt->rn_bit = -1 - off;
>> 	*ttt = *tt;
>> 	ttt->rn_key = rn_ones;
>> -	rnh->rnh_addaddr = rn_addroute;
>> -	rnh->rnh_deladdr = rn_delete;
>> -	rnh->rnh_matchaddr = rn_match;
>> -	rnh->rnh_lookup = rn_lookup;
>> -	rnh->rnh_walktree = rn_walktree;
>> -	rnh->rnh_walktree_from = rn_walktree_from;
>> -	rnh->rnh_treetop = t;
>> +	rnh->rnh_addaddr = (rn_addaddr_f_t *)rn_addroute;
>> +	rnh->rnh_deladdr = (rn_deladdr_f_t *)rn_delete;
>> +	rnh->rnh_matchaddr = (rn_matchaddr_f_t *)rn_match;
>> +	rnh->rnh_lookup = (rn_lookup_f_t *)rn_lookup;
>> +	rnh->rnh_walktree = (rn_walktree_t *)rn_walktree;
>> +	rnh->rnh_walktree_from = (rn_walktree_from_t *)rn_walktree_from;
>> +	rnh->rh.rnh_treetop = t;
>> 	return (1);
>> }
>> 
> 
> A previous commit added lots of function typedefs.  As I feared, most uses
> of these are to give undefined behaviour by bogusly casting using the
> typedefs.  Unless the function types are actually the same.  Then the
> bogus casts have no effect.
Yes, these changes are not final.

Currently we use radix for the following:
1) main routing table (where we have “route entries”, “multipath” and other routing-specific stuff). We also need to redefine some of callbacks for different address families.
2) prefix lists in NFS server, pf and ipfw firewall (and some other places). Here we don’t need callback re-definition, embedded locking and other stuff. 

My goal is to significantly change structure/binding of radix to routing table (change locking model, change callbacks and so on) so I’m trying to decouple
radix code from current routing-specific table structures as much as I can.

> 
> These typedefs don't seem to be used to obfuscate function definitions yet.
> 
> Bruce
> 



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D04D87A8-801B-482C-9D76-18B82FD8EA0E>