• Pablo Neira Ayuso's avatar
    netfilter: nfnetlink_queue: resolve clash for unconfirmed conntracks · 368982cd
    Pablo Neira Ayuso authored
    In nfqueue, two consecutive skbuffs may race to create the conntrack
    entry. Hence, the one that loses the race gets dropped due to clash in
    the insertion into the hashes from the nf_conntrack_confirm() path.
    
    This patch adds a new nf_conntrack_update() function which searches for
    possible clashes and resolve them. NAT mangling for the packet losing
    race is corrected by using the conntrack information that won race.
    
    In order to avoid direct module dependencies with conntrack and NAT, the
    nf_ct_hook and nf_nat_hook structures are used for this purpose.
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    368982cd
nf_conntrack_core.c 58.9 KB