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

netfilter: nf_conntrack: remove dead code

The following code is not used in current upstream code.
Some of this seems to be old hooks, other might be used by some
out of tree module (which I don't care about breaking), and
the need_ipv4_conntrack was used by old NAT code but no longer
called.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

stephen hemminger and committed by
Pablo Neira Ayuso
dcd93ed4 02eca9d2

-30
-2
include/net/netfilter/ipv4/nf_conntrack_ipv4.h
··· 19 19 int nf_conntrack_ipv4_compat_init(void); 20 20 void nf_conntrack_ipv4_compat_fini(void); 21 21 22 - void need_ipv4_conntrack(void); 23 - 24 22 #endif /*_NF_CONNTRACK_IPV4_H*/
-1
include/net/netfilter/nf_conntrack_l3proto.h
··· 87 87 void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); 88 88 89 89 struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); 90 - void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); 91 90 92 91 /* Existing built-in protocols */ 93 92 extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic;
-6
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
··· 548 548 549 549 module_init(nf_conntrack_l3proto_ipv4_init); 550 550 module_exit(nf_conntrack_l3proto_ipv4_fini); 551 - 552 - void need_ipv4_conntrack(void) 553 - { 554 - return; 555 - } 556 - EXPORT_SYMBOL_GPL(need_ipv4_conntrack);
-15
net/netfilter/nf_conntrack_core.c
··· 60 60 const struct nlattr *attr) __read_mostly; 61 61 EXPORT_SYMBOL_GPL(nfnetlink_parse_nat_setup_hook); 62 62 63 - int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb, 64 - struct nf_conn *ct, 65 - enum ip_conntrack_info ctinfo, 66 - unsigned int protoff); 67 - EXPORT_SYMBOL_GPL(nf_nat_seq_adjust_hook); 68 - 69 63 DEFINE_SPINLOCK(nf_conntrack_lock); 70 64 EXPORT_SYMBOL_GPL(nf_conntrack_lock); 71 65 ··· 354 360 355 361 return NULL; 356 362 } 357 - 358 - struct nf_conntrack_tuple_hash * 359 - __nf_conntrack_find(struct net *net, u16 zone, 360 - const struct nf_conntrack_tuple *tuple) 361 - { 362 - return ____nf_conntrack_find(net, zone, tuple, 363 - hash_conntrack_raw(tuple, zone)); 364 - } 365 - EXPORT_SYMBOL_GPL(__nf_conntrack_find); 366 363 367 364 /* Find a connection corresponding to a tuple. */ 368 365 static struct nf_conntrack_tuple_hash *
-6
net/netfilter/nf_conntrack_proto.c
··· 92 92 } 93 93 EXPORT_SYMBOL_GPL(nf_ct_l3proto_find_get); 94 94 95 - void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p) 96 - { 97 - module_put(p->me); 98 - } 99 - EXPORT_SYMBOL_GPL(nf_ct_l3proto_put); 100 - 101 95 int 102 96 nf_ct_l3proto_try_module_get(unsigned short l3proto) 103 97 {