Commit 6442f1cf authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETFILTER]: conntrack: don't call helpers for related ICMP messages

None of the existing helpers expects to get called for related ICMP
packets and some even drop them if they can't parse them.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 404bdbfd
...@@ -417,7 +417,7 @@ static unsigned int ip_conntrack_help(unsigned int hooknum, ...@@ -417,7 +417,7 @@ static unsigned int ip_conntrack_help(unsigned int hooknum,
/* This is where we call the helper: as the packet goes out. */ /* This is where we call the helper: as the packet goes out. */
ct = ip_conntrack_get(*pskb, &ctinfo); ct = ip_conntrack_get(*pskb, &ctinfo);
if (ct && ct->helper) { if (ct && ct->helper && ctinfo != IP_CT_RELATED + IP_CT_IS_REPLY) {
unsigned int ret; unsigned int ret;
ret = ct->helper->help(pskb, ct, ctinfo); ret = ct->helper->help(pskb, ct, ctinfo);
if (ret != NF_ACCEPT) if (ret != NF_ACCEPT)
......
...@@ -145,7 +145,7 @@ static unsigned int ipv4_conntrack_help(unsigned int hooknum, ...@@ -145,7 +145,7 @@ static unsigned int ipv4_conntrack_help(unsigned int hooknum,
/* This is where we call the helper: as the packet goes out. */ /* This is where we call the helper: as the packet goes out. */
ct = nf_ct_get(*pskb, &ctinfo); ct = nf_ct_get(*pskb, &ctinfo);
if (!ct) if (!ct || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY)
return NF_ACCEPT; return NF_ACCEPT;
help = nfct_help(ct); help = nfct_help(ct);
......
...@@ -189,7 +189,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum, ...@@ -189,7 +189,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum,
/* This is where we call the helper: as the packet goes out. */ /* This is where we call the helper: as the packet goes out. */
ct = nf_ct_get(*pskb, &ctinfo); ct = nf_ct_get(*pskb, &ctinfo);
if (!ct) if (!ct || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY)
goto out; goto out;
help = nfct_help(ct); help = nfct_help(ct);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment