All of lore.kernel.org
 help / color / mirror / Atom feed
* [helper PATCH] Preserve conntrack helper bound through CT rule
@ 2014-03-26 12:34 Alin Năstac
  2014-03-26 13:04 ` Florian Westphal
  0 siblings, 1 reply; 5+ messages in thread
From: Alin Năstac @ 2014-03-26 12:34 UTC (permalink / raw)
  To: netfilter-devel

Hi,

I've discovered that MASQUERADE target overwrites the CT --helper settings.
The setup I used is the following:
  iptables -t raw -A PREROUTING -i lan -p tcp --dport 2121 -j CT --helper ftp
  iptables -t nat -A POSTROUTING -o wan -s 192.168.1.0/24 -j MASQUERADE

I found out the problem, the helper set in the conntrack template is
overwritten by MASQUERADE target.
This patch fixes the issue:

diff --git a/net/netfilter/nf_conntrack_core.c
b/net/netfilter/nf_conntrack_core.c
index bba14a7..ab7cd3e 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1445,7 +1445,7 @@ void nf_conntrack_alter_reply(struct nf_conn *ct,
        nf_ct_dump_tuple(newreply);

        ct->tuplehash[IP_CT_DIR_REPLY].tuple = *newreply;
-       if (ct->master || (help && !hlist_empty(&help->expectations)))
+       if (ct->master || help)
                return;

        rcu_read_lock();

I didn't used the latest kernel, but seems the problem is still present.

Best regs,
Alin

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-26 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-26 12:34 [helper PATCH] Preserve conntrack helper bound through CT rule Alin Năstac
2014-03-26 13:04 ` Florian Westphal
2014-03-26 13:18   ` Alin Năstac
2014-03-26 16:57     ` Florian Westphal
2014-03-26 20:59       ` Alin Năstac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.