Subject: Re: iproute2 proposal

From: Patrick McHardy <[email-masked]>
Date: Wed, 06 Aug 2008 12:25:48 +0200

Denys Fedoryshchenko wrote:
> On Wednesday 06 August 2008, Patrick McHardy wrote:
> 
>> No patch attached ..
> 
> Sorry :-) Now must be attached

> +++ iproute2-patched/tc/m_mirred.c	2008-08-06 09:49:39.000000000 +0000
> @@ -27,6 +27,7 @@
>  #include <linux/tc_act/tc_mirred.h>
>  
>  int mirred_d = 1;
> +extern int link_cache;
>  
>  static void
>  explain(void)
> @@ -146,7 +147,10 @@
>  
>  	if (d[0])  {
>  		int idx;
> -		ll_init_map(&rth);
> +		if (!link_cache) {
> + 		    ll_init_map(&rth);
> +		    link_cache = 1;
> +		}

It would be nicer to avoid the initialization in ll_init_map() as
you did in your first patch and add an explicit ll_invalidate_map()
and call it when necessary (ip link add/del/change(?), ip tunnel
add/del/change(?)).