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

[NETFILTER]: nf_conntrack: move extern declaration to header files

Using extern in a C file is a bad idea because the compiler can't
catch type errors.

Signed-off-by: Patrick McHardy <kaber@trash.net>

authored by

Patrick McHardy and committed by
David S. Miller
f8eb24a8 d7346853

+34 -37
+4
include/net/netfilter/ipv4/nf_conntrack_ipv4.h
··· 37 37 struct sk_buff * 38 38 nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb); 39 39 40 + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; 41 + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; 42 + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; 43 + 40 44 #endif /*_NF_CONNTRACK_IPV4_H*/
+25
include/net/netfilter/ipv6/nf_conntrack_ipv6.h
··· 1 + #ifndef _NF_CONNTRACK_IPV6_H 2 + #define _NF_CONNTRACK_IPV6_H 3 + 4 + extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; 5 + 6 + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6; 7 + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; 8 + extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; 9 + 10 + extern int nf_ct_ipv6_skip_exthdr(struct sk_buff *skb, int start, 11 + u8 *nexthdrp, int len); 12 + 13 + extern int nf_ct_frag6_init(void); 14 + extern void nf_ct_frag6_cleanup(void); 15 + extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb); 16 + extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, 17 + struct net_device *in, 18 + struct net_device *out, 19 + int (*okfn)(struct sk_buff *)); 20 + 21 + extern unsigned int nf_ct_frag6_timeout; 22 + extern unsigned int nf_ct_frag6_low_thresh; 23 + extern unsigned int nf_ct_frag6_high_thresh; 24 + 25 + #endif /* _NF_CONNTRACK_IPV6_H*/
+5
include/net/netfilter/nf_conntrack.h
··· 79 79 80 80 81 81 #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> 82 + #include <net/netfilter/ipv6/nf_conntrack_ipv6.h> 83 + 82 84 struct nf_conn 83 85 { 84 86 /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, ··· 243 241 244 242 extern unsigned int nf_conntrack_htable_size; 245 243 extern int nf_conntrack_checksum; 244 + extern atomic_t nf_conntrack_count; 245 + extern int nf_conntrack_max; 246 246 247 + DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); 247 248 #define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) 248 249 249 250 /* no helper, no nat */
-6
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
··· 38 38 #define DEBUGP(format, args...) 39 39 #endif 40 40 41 - DECLARE_PER_CPU(struct nf_conntrack_stat, nf_conntrack_stat); 42 - 43 41 static int ipv4_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, 44 42 struct nf_conntrack_tuple *tuple) 45 43 { ··· 426 428 #endif 427 429 .me = THIS_MODULE, 428 430 }; 429 - 430 - extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; 431 - extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; 432 - extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; 433 431 434 432 MODULE_ALIAS("nf_conntrack-" __stringify(AF_INET)); 435 433 MODULE_LICENSE("GPL");
-18
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
··· 43 43 #define DEBUGP(format, args...) 44 44 #endif 45 45 46 - DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); 47 - 48 46 static int ipv6_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, 49 47 struct nf_conntrack_tuple *tuple) 50 48 { ··· 209 211 return nf_conntrack_confirm(pskb); 210 212 } 211 213 212 - extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb); 213 - extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, 214 - struct net_device *in, 215 - struct net_device *out, 216 - int (*okfn)(struct sk_buff *)); 217 214 static unsigned int ipv6_defrag(unsigned int hooknum, 218 215 struct sk_buff **pskb, 219 216 const struct net_device *in, ··· 328 335 /* From nf_conntrack_proto_icmpv6.c */ 329 336 extern unsigned int nf_ct_icmpv6_timeout; 330 337 331 - /* From nf_conntrack_reasm.c */ 332 - extern unsigned int nf_ct_frag6_timeout; 333 - extern unsigned int nf_ct_frag6_low_thresh; 334 - extern unsigned int nf_ct_frag6_high_thresh; 335 - 336 338 static struct ctl_table_header *nf_ct_ipv6_sysctl_header; 337 339 338 340 static ctl_table nf_ct_sysctl_table[] = { ··· 445 457 .get_features = ipv6_get_features, 446 458 .me = THIS_MODULE, 447 459 }; 448 - 449 - extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6; 450 - extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; 451 - extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; 452 - extern int nf_ct_frag6_init(void); 453 - extern void nf_ct_frag6_cleanup(void); 454 460 455 461 MODULE_ALIAS("nf_conntrack-" __stringify(AF_INET6)); 456 462 MODULE_LICENSE("GPL");
-3
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
··· 142 142 return 1; 143 143 } 144 144 145 - extern int 146 - nf_ct_ipv6_skip_exthdr(struct sk_buff *skb, int start, u8 *nexthdrp, int len); 147 - extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; 148 145 static int 149 146 icmpv6_error_message(struct sk_buff *skb, 150 147 unsigned int icmp6off,
-1
net/netfilter/nf_conntrack_expect.c
··· 28 28 29 29 LIST_HEAD(nf_conntrack_expect_list); 30 30 kmem_cache_t *nf_conntrack_expect_cachep __read_mostly; 31 - DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); 32 31 static unsigned int nf_conntrack_expect_next_id; 33 32 34 33 /* nf_conntrack_expect helper functions */
-2
net/netfilter/nf_conntrack_l3proto_generic.c
··· 37 37 #define DEBUGP(format, args...) 38 38 #endif 39 39 40 - DECLARE_PER_CPU(struct nf_conntrack_stat, nf_conntrack_stat); 41 - 42 40 static int generic_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, 43 41 struct nf_conntrack_tuple *tuple) 44 42 {
-7
net/netfilter/nf_conntrack_standalone.c
··· 44 44 45 45 MODULE_LICENSE("GPL"); 46 46 47 - extern atomic_t nf_conntrack_count; 48 - DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); 49 - 50 47 #ifdef CONFIG_PROC_FS 51 48 int 52 49 print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, ··· 330 333 int nf_conntrack_checksum __read_mostly = 1; 331 334 332 335 #ifdef CONFIG_SYSCTL 333 - 334 - /* From nf_conntrack_core.c */ 335 - extern int nf_conntrack_max; 336 - extern unsigned int nf_conntrack_htable_size; 337 336 338 337 /* From nf_conntrack_proto_tcp.c */ 339 338 extern unsigned int nf_ct_tcp_timeout_syn_sent;