• Liping Zhang's avatar
    netfilter: nf_ct_ext: invoke destroy even when ext is not attached · 8eeef235
    Liping Zhang authored
    For NF_NAT_MANIP_SRC, we will insert the ct to the nat_bysource_table,
    then remove it from the nat_bysource_table via nat_extend->destroy.
    
    But now, the nat extension is attached on demand, so if the nat extension
    is not attached, we will not be notified when the ct is destroyed, i.e.
    we may fail to remove ct from the nat_bysource_table.
    
    So just keep it simple, even if the extension is not attached, we will
    still invoke the related ext->destroy. And this will also preserve the
    flexibility for the future extension.
    
    Fixes: 9a08ecfe ("netfilter: don't attach a nat extension by default")
    Signed-off-by: default avatarLiping Zhang <zlpnobody@gmail.com>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    8eeef235
nf_conntrack_extend.c 3.03 KB