netfilter: SYNPROXY core: fix warning in __nf_ct_ext_add_length()
Subsystems (2)
PATCH 1/1 netfilter: SYNPROXY core: fix warning in __nf_ct_ext_add_length()
With CONFIG_NETFILTER_DEBUG we get the following warning during SYNPROXY init:
[ 80.558906] WARNING: CPU: 1 PID: 4833 at net/netfilter/nf_conntrack_extend.c:80 __nf_ct_ext_add_length+0x217/0x220 [nf_conntrack]()
The reason is that the conntrack template is set to confirmed before adding the extension and it is invalid to add extensions to already confirmed conntracks. Fix by adding the extensions before setting the conntrack to confirmed.
--- net/netfilter/nf_synproxy_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_synproxy_core.c +2 -2
@@ -356,12 +356,12 @@ static int __net_init synproxy_net_init(struct net *net) goto err1; } -__set_bit (IPS_TEMPLATE_BIT , &ct->status); -__set_bit (IPS_CONFIRMED_BIT , &ct->status);if (!nfct_seqadj_ext_add (ct)) goto err2;if (!nfct_synproxy_ext_add (ct)) goto err2; +__set_bit (IPS_TEMPLATE_BIT , &ct->status); +__set_bit (IPS_CONFIRMED_BIT , &ct->status); snet->tmpl = ct;
Signature · 1 line
1.8.1.4
Quoted 11 lines · On Thu, 29 Aug 2013 10:32:09 +0200 Patrick McHardy <[email protected]> wrote:
With
CONFIG_NETFILTER_DEBUGwe get the following warning during SYNPROXY init:[ 80.558906] WARNING: CPU: 1 PID: 4833 at net/netfilter/nf_conntrack_extend.c:80 __nf_ct_ext_add_length+0x217/0x220 [nf_conntrack]()The reason is that the conntrack template is set to confirmed before adding the extension and it is invalid to add extensions to already confirmed conntracks. Fix by adding the extensions before setting the conntrack to confirmed.
Reported-by Jesper Dangaard Brouer <[email protected]>Signed-off-by Patrick McHardy <[email protected]>
I have verified that the warning is gone after this patch, thanks!
Signature · 5 lines
Best regards, Jesper Dangaard Brouer MSc.CS, Sr. Network Kernel Developer at Red Hat Author of http://www.iptv-analyzer.org LinkedIn: http://www.linkedin.com/in/brouer
Quoted 12 lines · Jesper Dangaard Brouer
Quoted 9 lines · On Thu, 29 Aug 2013 10:32:09 +0200 Patrick McHardy <[email protected]> wrote:
With
CONFIG_NETFILTER_DEBUGwe get the following warning during SYNPROXY init:[ 80.558906] WARNING: CPU: 1 PID: 4833 at net/netfilter/nf_conntrack_extend.c:80 __nf_ct_ext_add_length+0x217/0x220 [nf_conntrack]()The reason is that the conntrack template is set to confirmed before adding the extension and it is invalid to add extensions to already confirmed conntracks. Fix by adding the extensions before setting the conntrack to confirmed.
Quoted 4 lines
Quoted 2 lines
Reported-by Jesper Dangaard Brouer <[email protected]>Signed-off-by Patrick McHardy <[email protected]>
Applied, thanks.
Quoted 8 lines · Patrick McHardy
With
CONFIG_NETFILTER_DEBUGwe get the following warning during SYNPROXY init:[ 80.558906] WARNING: CPU: 1 PID: 4833 at net/netfilter/nf_conntrack_extend.c:80 __nf_ct_ext_add_length+0x217/0x220 [nf_conntrack]()The reason is that the conntrack template is set to confirmed before adding the extension and it is invalid to add extensions to already confirmed conntracks. Fix by adding the extensions before setting the conntrack to confirmed.
applied, thanks Patrick.