Commit 1c10c057 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[XFRM]: Fix endless loop in xfrm_policy_insert

The patch 'Fix policy update bug when increasing
priority of last policy' broke this, when a policy
with lower priority than an existing policy is inserted
xfrm_policy_insert loops forever.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ac1ac459
...@@ -353,6 +353,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) ...@@ -353,6 +353,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
newpos = p; newpos = p;
if (delpol) if (delpol)
break; break;
p = &pol->next;
} }
if (newpos) if (newpos)
p = newpos; p = newpos;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment