]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[NETFILTER]: conntrack: don't call helpers for related ICMP messages
authorPatrick McHardy <kaber@trash.net>
Tue, 30 May 2006 01:21:53 +0000 (18:21 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 18 Jun 2006 04:28:55 +0000 (21:28 -0700)
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: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/ip_conntrack_standalone.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c

index 929d61f7be91589b6ce2022ffd01dfc68767dc31..f0cc7feb0da3795f1d5e390ae722543b2ea5a13f 100644 (file)
@@ -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. */
        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;
                ret = ct->helper->help(pskb, ct, ctinfo);
                if (ret != NF_ACCEPT)
index 77d974443c7b6291e54ca4713945a0a53d582167..8cc8e1b3677894283bd047121a179fce74d80b8e 100644 (file)
@@ -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. */
        ct = nf_ct_get(*pskb, &ctinfo);
-       if (!ct)
+       if (!ct || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY)
                return NF_ACCEPT;
 
        help = nfct_help(ct);
index 93bae36f2663e03370e8016da83ae4a43843e6ad..2a71c3b669f17993b562cd1875a7b4f04e082b38 100644 (file)
@@ -189,7 +189,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum,
 
        /* This is where we call the helper: as the packet goes out. */
        ct = nf_ct_get(*pskb, &ctinfo);
-       if (!ct)
+       if (!ct || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY)
                goto out;
 
        help = nfct_help(ct);