svn commit: r274256 - in projects/routing/sys: net netinet netinet6 netpfil/pf

Bruce Evans brde at optusnet.com.au
Fri Nov 7 23:50:05 UTC 2014


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.

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

Bruce


More information about the svn-src-projects mailing list