net: split rt_genid for ipv4 and ipv6
Current net name space has only one genid for both IPv4 and IPv6, it has below drawbacks: - Add/delete an IPv4 address will invalidate all IPv6 routing table entries. - Insert/remove XFRM policy will also invalidate both IPv4/IPv6 routing table entries even when the policy is only applied for one address family. Thus, this patch attempt to split one genid for two to cater for IPv4 and IPv6 separately in a fine granularity. Signed-off-by: Fan Du <fan.du@windriver.com> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -660,7 +660,13 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
|
||||
xfrm_pol_hold(policy);
|
||||
net->xfrm.policy_count[dir]++;
|
||||
atomic_inc(&flow_cache_genid);
|
||||
rt_genid_bump(net);
|
||||
|
||||
/* After previous checking, family can either be AF_INET or AF_INET6 */
|
||||
if (policy->family == AF_INET)
|
||||
rt_genid_bump_ipv4(net);
|
||||
else
|
||||
rt_genid_bump_ipv6(net);
|
||||
|
||||
if (delpol) {
|
||||
xfrm_policy_requeue(delpol, policy);
|
||||
__xfrm_policy_unlink(delpol, dir);
|
||||
|
Reference in New Issue
Block a user