static int __net_init arptable_filter_net_init(struct net *net) { struct arpt_replace *repl; repl = arpt_alloc_initial_table(&packet_filter); if (repl == NULL) return -ENOMEM; net->ipv4.arptable_filter = arpt_register_table(net, &packet_filter, repl); kfree(repl); return PTR_ERR_OR_ZERO(net->ipv4.arptable_filter); }
static int __net_init arptable_filter_table_init(struct net *net) { struct arpt_replace *repl; int err; if (net->ipv4.arptable_filter) return 0; repl = arpt_alloc_initial_table(&packet_filter); if (repl == NULL) return -ENOMEM; err = arpt_register_table(net, &packet_filter, repl, arpfilter_ops, &net->ipv4.arptable_filter); kfree(repl); return err; }