• Herbert Xu's avatar
    [IPSEC]: Fix xfrm_tunnel leak. · d10920ba
    Herbert Xu authored
    Turns out that the IPIP tunnel used by IPCOMP states are only freed
    if the IPCOMP state is deleted by xfrm_state_delete.
    
    This is not the case for all states.  For example, an immature IPCOMP
    state that dies in add_sa will not go through xfrm_state_delete.
    
    The following patch moves the delete_tunnel call into IPCOMP's
    destructor.  I think it makes more sense there as IPCOMP is the
    only user of the tunnel anyway.
    d10920ba
xfrm_state.c 20.8 KB