Patrick McHardy wrote: > David Miller wrote: > >>I really don't want to remove this as it's fairly critical performance >>wise for the scalability problems all my changes were meant to address. >>I hope I really don't have to do something like what was needed for >>the policy layer, having a linked list and a hash table to handle the >>two cases. > > > We could query the address before the SA lookup. It will cost an > additional route lookup in case a matching SA is already present, > but I guess thats still better than removing the source from the > hash. I'll try if it works and send a new patch. I've tested this patch and it works fine. I'm wondering if something else might be affected by the hash change though, xfrm_state_addr_check treated 0.0.0.0 as wildcard even before the introduction of wildcards in tunnel templates, but I can't see in which other case it would be zero.