Make 2.6.9-rc1-bk9 compile without CONFIG_SYSCTL
Subsystems (2)
PATCH 1/1 Make 2.6.9-rc1-bk9 compile without CONFIG_SYSCTL
Discovered this by accident (nfsim doesn't turn on CONFIG_SYSCTL).
Name: Make sure conntrack compiles without CONFIG_SYSCTL (ip_ct_log_invalid)
Status: Untested
Signed-off-by Rusty Russell <[email protected]>
ip_ct_log_invalid was added without testing that it compiles without CONFIG_SYSCTL. Since sysctl is the only way of turning it on, there should be no references to it if !CONFIG_SYSCTL. Also, that turns off CONFIG_PROC_FS, which elicits more warnings. Squish them too.
include/linux/netfilter_ipv4/ip_conntrack_protocol.h +4 -0
@@ -75,6 +75,7 @@ extern int ip_conntrack_protocol_tcp_ini/* Log invalid packets */ extern unsigned int ip_ct_log_invalid; +#ifdef CONFIG_SYSCTL #ifdef DEBUG_INVALID_PACKETS #define LOG_INVALID (proto) \ (ip_ct_log_invalid == (proto) || ip_ct_log_invalid == IPPROTO_RAW)
@@ -83,5 +84,8 @@ extern unsigned int ip_ct_log_invalid; ((ip_ct_log_invalid == (proto) || ip_ct_log_invalid ==IPPROTO_RAW ) \ && net_ratelimit())#endif +#else +#define LOG_INVALID (proto) 0 +#endif /* CONFIG_SYSCTL */ #endif /*_IP_CONNTRACK_PROTOCOL_H*/
net/ipv4/netfilter/ip_conntrack_proto_sctp.c +1 -1
@@ -623,8 +623,8 @@ int __init init(void)return ret; - cleanup:#ifdef CONFIG_SYSCTL + cleanup:ip_conntrack_protocol_unregister (&ip_conntrack_protocol_sctp);#endif out:
net/ipv4/netfilter/ip_conntrack_standalone.c +15 -6
@@ -54,6 +54,7 @@ static int kill_proto(const struct ip_co *((u_int8_t *) data)); } +#ifdef CONFIG_PROC_FS static unsigned int print_tuple (char *buffer,const struct ip_conntrack_tuple *tuple,struct ip_conntrack_protocol *proto)
@@ -367,6 +368,7 @@ static struct file_operations ct_cpu_seq .llseek = seq_lseek, .release = seq_release_private, }; +#endif static unsigned int ip_confirm(unsigned int hooknum, struct sk_buff **pskb,
@@ -726,10 +728,15 @@ static ctl_table ip_ct_net_table[] = { }, { .ctl_name = 0 } }; -#endif + +EXPORT_SYMBOL (ip_ct_log_invalid); +#endif /* CONFIG_SYSCTL */ +static int init_or_cleanup (int init) { +#ifdef CONFIG_PROC_FS struct proc_dir_entry *proc, *proc_exp, *proc_stat; +#endif int ret =0 ;if (!init) goto cleanup;
@@ -738,19 +745,20 @@ static int init_or_cleanup(int init)if (ret <0 ) goto cleanup_nothing; - proc =proc_net_create ("ip_conntrack" ,0440 ,NULL ); +#ifdef CONFIG_PROC_FS + proc =proc_net_fops_create ("ip_conntrack" ,0440 , &ct_file_ops);if (!proc) goto cleanup_init; - proc->proc_fops = &ct_file_ops; - proc_exp =proc_net_create ("ip_conntrack_expect" ,0440 ,NULL ); + proc_exp =proc_net_fops_create ("ip_conntrack_expect" ,0440 , + &exp_file_ops);if (!proc_exp) goto cleanup_proc; - proc_exp->proc_fops = &exp_file_ops; proc_stat =proc_net_fops_create ("ip_conntrack_stat" ,S_IRUGO , &ct_cpu_seq_fops);if (!proc_stat) goto cleanup_proc_exp; proc_stat->owner =THIS_MODULE ; +#endif ret =nf_register_hook (&ip_conntrack_defrag_ops);if (ret <0 ) {
@@ -814,12 +822,14 @@ static int init_or_cleanup(int init)local_bh_enable ();nf_unregister_hook (&ip_conntrack_defrag_ops); cleanup_proc_stat: +#ifdef CONFIG_PROC_FS proc_net_remove ("ip_conntrack_stat" ); cleanup_proc_exp:proc_net_remove ("ip_conntrack_exp" ); cleanup_proc:proc_net_remove ("ip_conntrack" ); cleanup_init: +#endif /* CONFIG_PROC_FS */ ip_conntrack_cleanup (); cleanup_nothing:return ret;
@@ -912,4 +922,3 @@ EXPORT_SYMBOL(ip_conntrack_hash);EXPORT_SYMBOL (ip_conntrack_untracked);EXPORT_SYMBOL_GPL (ip_conntrack_find_get);EXPORT_SYMBOL_GPL (ip_conntrack_put); -EXPORT_SYMBOL (ip_ct_log_invalid);
net/ipv4/netfilter/ip_queue.c +2 -0
@@ -619,6 +619,7 @@ static ctl_table ipq_root_table[] = { { .ctl_name = 0 } }; +#ifdef CONFIG_PROC_FS static int ipq_get_info (char *buffer,char **start,off_t offset,int length) {
@@ -648,6 +649,7 @@ ipq_get_info(char *buffer, char **start, len =0 ; return len; } +#endif /* CONFIG_PROC_FS */ static int init_or_cleanup (int init)
Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell