• Florian Westphal's avatar
    netfilter: xt_nat: pass table to hookfn · a4aeafa2
    Florian Westphal authored
    This changes how ip(6)table nat passes the ruleset/table to the
    evaluation loop.
    
    At the moment, it will fetch the table from struct net.
    
    This change stores the table in the hook_ops 'priv' argument
    instead.
    
    This requires to duplicate the hook_ops for each netns, so
    they can store the (per-net) xt_table structure.
    
    The dupliated nat hook_ops get stored in net_generic data area.
    They are free'd in the namespace exit path.
    
    This is a pre-requisite to remove the xt_table/ruleset pointers
    from struct net.
    Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    a4aeafa2
iptable_nat.c 3.82 KB