[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4978055A.7060102@iki.fi>
Date: Thu, 22 Jan 2009 07:34:18 +0200
From: Timo Teräs <timo.teras@....fi>
To: David Miller <davem@...emloft.net>
CC: netdev@...r.kernel.org, kuznet@....inr.ac.ru
Subject: Re: [PATCH] gre: strict physical device binding
David Miller wrote:
> From: David Miller <davem@...emloft.net>
> Date: Mon, 19 Jan 2009 17:22:24 -0800 (PST)
>
>> From: Timo Teras <timo.teras@....fi>
>> Date: Mon, 19 Jan 2009 12:50:05 +0200
>>
>>> Check the device on receive path and allow otherwise identical devices
>>> as long as the physical device differs.
>>>
>>> This is useful for NBMA tunnels, where you want to use different gre IP
>>> for each public IP available via different physical devices.
>>>
>>> Signed-off-by: Timo Teras <timo.teras@....fi>
>> Seems reasonable, applied.
>>
>> Thanks Timo.
>
> BTW, isn't it much more efficient to implement this priority scoring
> using a simple integer instead of this big honking 4 entry array of
> pointers on the stack (one entry of which isn't even _used_)?
>
> Something like:
>
> int score = 4;
>
> ...
> for_each_hash_chain() {
> if (!match)
> continue;
> if (exact_match)
> return this_entry;
> this_score = 0;
> if (condition1)
> this_score |= 2;
> if (condition2)
> this_score |= 1;
> if (this_score < score) {
> score = this_score;
> cand = this_entry;
> }
> }
> ...
> return cand;
I guess so, well send updated patch.
- Timo
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists