• Xin Long's avatar
    xfrm: do the garbage collection after flushing policy · 35db0691
    Xin Long authored
    
    
    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: default avatarXin Long <lucien.xin@gmail.com>
    Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
    35db0691
xfrm_policy.c 80.9 KB