static int __net_init nf_nat_rule_net_init(struct net *net) { if (!net_ipt_permitted(net, VE_IP_IPTABLE_NAT)) return 0; net->ipv4.nat_table = ipt_register_table(net, &nat_table, &nat_initial_table.repl); if (IS_ERR(net->ipv4.nat_table)) return PTR_ERR(net->ipv4.nat_table); net_ipt_module_set(net, VE_IP_IPTABLE_NAT); return 0; }
static int __net_init iptable_filter_net_init(struct net *net) { if (!net_ipt_permitted(net, VE_IP_FILTER)) return 0; /* Register table */ net->ipv4.iptable_filter = ipt_register_table(net, &packet_filter, &initial_table.repl); if (IS_ERR(net->ipv4.iptable_filter)) return PTR_ERR(net->ipv4.iptable_filter); net_ipt_module_set(net, VE_IP_FILTER); return 0; }