Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: conntrack: remove unused init_net hook

since adf0516845bcd0 ("netfilter: remove ip_conntrack* sysctl compat code")
the only user (ipv4 tracker) sets this to an empty stub function.

After this change nf_ct_l3proto_pernet_register() is also empty,
but this will change in a followup patch to add conditional register
of the hooks.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Florian Westphal and committed by
Pablo Neira Ayuso
a379854d 9b91c96c

-17
-3
include/net/netfilter/nf_conntrack_l3proto.h
··· 63 63 64 64 size_t nla_size; 65 65 66 - /* Init l3proto pernet data */ 67 - int (*init_net)(struct net *net); 68 - 69 66 /* Module (if any) which this is connected to. */ 70 67 struct module *me; 71 68 };
-6
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
··· 307 307 .owner = THIS_MODULE, 308 308 }; 309 309 310 - static int ipv4_init_net(struct net *net) 311 - { 312 - return 0; 313 - } 314 - 315 310 struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = { 316 311 .l3proto = PF_INET, 317 312 .name = "ipv4", ··· 320 325 .nlattr_to_tuple = ipv4_nlattr_to_tuple, 321 326 .nla_policy = ipv4_nla_policy, 322 327 #endif 323 - .init_net = ipv4_init_net, 324 328 .me = THIS_MODULE, 325 329 }; 326 330
-8
net/netfilter/nf_conntrack_proto.c
··· 193 193 int nf_ct_l3proto_pernet_register(struct net *net, 194 194 struct nf_conntrack_l3proto *proto) 195 195 { 196 - int ret; 197 - 198 - if (proto->init_net) { 199 - ret = proto->init_net(net); 200 - if (ret < 0) 201 - return ret; 202 - } 203 - 204 196 return 0; 205 197 } 206 198 EXPORT_SYMBOL_GPL(nf_ct_l3proto_pernet_register);