aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_policy.c
diff options
context:
space:
mode:
authorfan.du <fan.du@windriver.com>2013-07-29 20:33:53 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-31 17:56:36 -0400
commitca4c3fc24e293719fe7410c4e63da9b6bc633b83 (patch)
tree0461841f3d10b11a26ebe1a0adc99c7b00a489a2 /net/xfrm/xfrm_policy.c
parentba361cb3d4c977e2b94b5d97905f66b4d48964de (diff)
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>
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r--net/xfrm/xfrm_policy.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index e52cab3591dd..d8da6b8c6ba8 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -660,7 +660,13 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
660 xfrm_pol_hold(policy); 660 xfrm_pol_hold(policy);
661 net->xfrm.policy_count[dir]++; 661 net->xfrm.policy_count[dir]++;
662 atomic_inc(&flow_cache_genid); 662 atomic_inc(&flow_cache_genid);
663 rt_genid_bump(net); 663
664 /* After previous checking, family can either be AF_INET or AF_INET6 */
665 if (policy->family == AF_INET)
666 rt_genid_bump_ipv4(net);
667 else
668 rt_genid_bump_ipv6(net);
669
664 if (delpol) { 670 if (delpol) {
665 xfrm_policy_requeue(delpol, policy); 671 xfrm_policy_requeue(delpol, policy);
666 __xfrm_policy_unlink(delpol, dir); 672 __xfrm_policy_unlink(delpol, dir);