diff options
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
| -rw-r--r-- | net/xfrm/xfrm_policy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index ec94f5795ea4..21e939235b39 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -912,6 +912,7 @@ restart: | |||
| 912 | } else if (delta > 0) { | 912 | } else if (delta > 0) { |
| 913 | p = &parent->rb_right; | 913 | p = &parent->rb_right; |
| 914 | } else { | 914 | } else { |
| 915 | bool same_prefixlen = node->prefixlen == n->prefixlen; | ||
| 915 | struct xfrm_policy *tmp; | 916 | struct xfrm_policy *tmp; |
| 916 | 917 | ||
| 917 | hlist_for_each_entry(tmp, &n->hhead, bydst) { | 918 | hlist_for_each_entry(tmp, &n->hhead, bydst) { |
| @@ -919,9 +920,11 @@ restart: | |||
| 919 | hlist_del_rcu(&tmp->bydst); | 920 | hlist_del_rcu(&tmp->bydst); |
| 920 | } | 921 | } |
| 921 | 922 | ||
| 923 | node->prefixlen = prefixlen; | ||
| 924 | |||
| 922 | xfrm_policy_inexact_list_reinsert(net, node, family); | 925 | xfrm_policy_inexact_list_reinsert(net, node, family); |
| 923 | 926 | ||
| 924 | if (node->prefixlen == n->prefixlen) { | 927 | if (same_prefixlen) { |
| 925 | kfree_rcu(n, rcu); | 928 | kfree_rcu(n, rcu); |
| 926 | return; | 929 | return; |
| 927 | } | 930 | } |
| @@ -929,7 +932,6 @@ restart: | |||
| 929 | rb_erase(*p, new); | 932 | rb_erase(*p, new); |
| 930 | kfree_rcu(n, rcu); | 933 | kfree_rcu(n, rcu); |
| 931 | n = node; | 934 | n = node; |
| 932 | n->prefixlen = prefixlen; | ||
| 933 | goto restart; | 935 | goto restart; |
| 934 | } | 936 | } |
| 935 | } | 937 | } |
