net/ipv4/netfilter/nf_defrag_ipv4.c:110:9: error: 'struct net' has no member named 'ct'
Subsystems (2)
kbuild test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master head: 7464293d4266a7b29565a4705d3fb2339350f9e2 commit: 018914b2c913bcc9c571ae5a781280c76a15ddad [18/28] netfilter: defrag: only register defrag functionality if needed config: i386-randconfig-i1-201649 (attached as .config) compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4 reproduce: git checkout 018914b2c913bcc9c571ae5a781280c76a15ddad # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>):
net/ipv4/netfilter/nf_defrag_ipv4.c: In function 'defrag4_net_exit':
>> net/ipv4/netfilter/nf_defrag_ipv4.c:110:9: error: 'struct net' has no member named 'ct'
if (net->ct.defrag_ipv4) {
^
net/ipv4/netfilter/nf_defrag_ipv4.c:113:6: error: 'struct net' has no member named 'ct'
net->ct.defrag_ipv4 = false;
^
net/ipv4/netfilter/nf_defrag_ipv4.c: In function 'nf_defrag_ipv4_enable':
net/ipv4/netfilter/nf_defrag_ipv4.c:137:9: error: 'struct net' has no member named 'ct'
if (net->ct.defrag_ipv4)
^
net/ipv4/netfilter/nf_defrag_ipv4.c:141:9: error: 'struct net' has no member named 'ct'
if (net->ct.defrag_ipv4)
^
net/ipv4/netfilter/nf_defrag_ipv4.c:147:6: error: 'struct net' has no member named 'ct'
net->ct.defrag_ipv4 = true;
^vim +110 net/ipv4/netfilter/nf_defrag_ipv4.c
104 .priority = NF_IP_PRI_CONNTRACK_DEFRAG,
105 },
106 };
107
108 static void __net_exit defrag4_net_exit(struct net *net)
109 {
> 110 if (net->ct.defrag_ipv4) { 111 nf_unregister_net_hooks(net, ipv4_defrag_ops,
112 ARRAY_SIZE(ipv4_defrag_ops));
113 net->ct.defrag_ipv4 = false;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Florian Westphal
maintainerPATCH 1/1 netfilter: fix build failure with CONNTRACK=n NF_DEFRAG=y
conntrack depends on defrag support, but not vice versa, so we cannot place defrag_ipv4/6 into netns->ct:
net/ipv4/netfilter/nf_defrag_ipv4.c:110:9: error: 'struct net' has no member named 'ct'
Move it into net->nf.
---
Pablo, if you prefer to squash I have no objections.
include/net/netns/conntrack.h | 2 -- include/net/netns/netfilter.h | 6 ++++++ net/ipv4/netfilter/nf_defrag_ipv4.c | 10 +++++----- net/ipv6/netfilter/nf_defrag_ipv6_hooks.c | 10 +++++----- 4 files changed, 16 insertions(+), 12 deletions(-)
include/net/netns/conntrack.h +0 -2
@@ -124,8 +124,6 @@ struct netns_ct {int sysctl_acct;int sysctl_auto_assign_helper;bool auto_assign_helper_warned; -bool defrag_ipv4; -bool defrag_ipv6;int sysctl_tstamp;int sysctl_checksum;
include/net/netns/netfilter.h +6 -0
@@ -17,5 +17,11 @@ struct netns_nf {struct ctl_table_header *nf_log_dir_header;#endif struct nf_hook_entry __rcu *hooks[NFPROTO_NUMPROTO ][NF_MAX_HOOKS ]; +#if IS_ENABLED (CONFIG_NF_DEFRAG_IPV4 ) +bool defrag_ipv4; +#endif +#if IS_ENABLED (CONFIG_NF_DEFRAG_IPV6 ) +bool defrag_ipv6; +#endif };#endif
net/ipv4/netfilter/nf_defrag_ipv4.c +5 -5
@@ -107,10 +107,10 @@ static struct nf_hook_ops ipv4_defrag_ops[] = { static void __net_exit defrag4_net_exit(struct net *net) { -if (net->ct.defrag_ipv4) { +if (net->nf.defrag_ipv4) {nf_unregister_net_hooks (net, ipv4_defrag_ops,ARRAY_SIZE (ipv4_defrag_ops)); - net->ct.defrag_ipv4 = false; + net->nf.defrag_ipv4 = false; } }
@@ -134,17 +134,17 @@ int nf_defrag_ipv4_enable(struct net *net)might_sleep (); -if (net->ct.defrag_ipv4) +if (net->nf.defrag_ipv4)return 0 ;mutex_lock (&defrag4_mutex); -if (net->ct.defrag_ipv4) +if (net->nf.defrag_ipv4) goto out_unlock; err =nf_register_net_hooks (net, ipv4_defrag_ops,ARRAY_SIZE (ipv4_defrag_ops));if (err ==0 ) - net->ct.defrag_ipv4 = true; + net->nf.defrag_ipv4 = true; out_unlock:mutex_unlock (&defrag4_mutex);
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c +5 -5
@@ -91,10 +91,10 @@ static struct nf_hook_ops ipv6_defrag_ops[] = { static void __net_exit defrag6_net_exit(struct net *net) { -if (net->ct.defrag_ipv6) { +if (net->nf.defrag_ipv6) {nf_unregister_net_hooks (net, ipv6_defrag_ops,ARRAY_SIZE (ipv6_defrag_ops)); - net->ct.defrag_ipv6 = false; + net->nf.defrag_ipv6 = false; } }
@@ -136,17 +136,17 @@ int nf_defrag_ipv6_enable(struct net *net)might_sleep (); -if (net->ct.defrag_ipv6) +if (net->nf.defrag_ipv6)return 0 ;mutex_lock (&defrag6_mutex); -if (net->ct.defrag_ipv6) +if (net->nf.defrag_ipv6) goto out_unlock; err =nf_register_net_hooks (net, ipv6_defrag_ops,ARRAY_SIZE (ipv6_defrag_ops));if (err ==0 ) - net->ct.defrag_ipv6 = true; + net->nf.defrag_ipv6 = true; out_unlock:mutex_unlock (&defrag6_mutex);
Signature · 1 line
2.7.3
Re: [PATCH nf-next] netfilter: fix build failure with CONNTRACK=n NF_DEFRAG=y
Quoted 6 lines · Florian Westphal
conntrack depends on defrag support, but not vice versa, so we cannot place defrag_ipv4/6 into
netns->ct:
net/ipv4/netfilter/nf_defrag_ipv4.c:110:9: error: 'struct net' has no member named 'ct'Move it into
net->nf.
Applied, thanks Florian.