OSDN Git Service

xfrm: do the garbage collection after flushing policy
authorXin Long <lucien.xin@gmail.com>
Mon, 24 Apr 2017 07:33:39 +0000 (15:33 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 26 Apr 2017 08:34:32 +0000 (10:34 +0200)
commit35db0691218959f05efbe26fd623ee67581ebff6
tree4d1653ab048e9a208bed8f2229943bc7c1474ddc
parentfd2c83b35752f0a8236b976978ad4658df14a59f
xfrm: do the garbage collection after flushing policy

Now xfrm garbage collection can be triggered by 'ip xfrm policy del'.
These is no reason not to do it after flushing policies, especially
considering that 'garbage collection deferred' is only triggered
when it reaches gc_thresh.

It's no good that the policy is gone but the xdst still hold there.
The worse thing is that xdst->route/orig_dst is also hold and can
not be released even if the orig_dst is already expired.

This patch is to do the garbage collection if there is any policy
removed in xfrm_policy_flush.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_policy.c