aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-11-03 09:44:42 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2016-11-08 17:53:37 -0500
commit6114cc516dcc0d311badb83ad7db5aa4b611bea6 (patch)
treee1d791b97983fd274ea3c47219f953562efec2d3
parentfb9c9649a1d0a65a8f94f784aa18252a0dd584c1 (diff)
netfilter: conntrack: fix CT target for UNSPEC helpers
Thomas reports its not possible to attach the H.245 helper: iptables -t raw -A PREROUTING -p udp -j CT --helper H.245 iptables: No chain/target/match by that name. xt_CT: No such helper "H.245" This is because H.245 registers as NFPROTO_UNSPEC, but the CT target passes NFPROTO_IPV4/IPV6 to nf_conntrack_helper_try_module_get. We should treat UNSPEC as wildcard and ignore the l3num instead. Reported-by: Thomas Woerner <twoerner@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--net/netfilter/nf_conntrack_helper.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
index 336e21559e01..7341adf7059d 100644
--- a/net/netfilter/nf_conntrack_helper.c
+++ b/net/netfilter/nf_conntrack_helper.c
@@ -138,9 +138,14 @@ __nf_conntrack_helper_find(const char *name, u16 l3num, u8 protonum)
138 138
139 for (i = 0; i < nf_ct_helper_hsize; i++) { 139 for (i = 0; i < nf_ct_helper_hsize; i++) {
140 hlist_for_each_entry_rcu(h, &nf_ct_helper_hash[i], hnode) { 140 hlist_for_each_entry_rcu(h, &nf_ct_helper_hash[i], hnode) {
141 if (!strcmp(h->name, name) && 141 if (strcmp(h->name, name))
142 h->tuple.src.l3num == l3num && 142 continue;
143 h->tuple.dst.protonum == protonum) 143
144 if (h->tuple.src.l3num != NFPROTO_UNSPEC &&
145 h->tuple.src.l3num != l3num)
146 continue;
147
148 if (h->tuple.dst.protonum == protonum)
144 return h; 149 return h;
145 } 150 }
146 } 151 }