]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
[NETFILTER]: NAT annotations
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / nf_conntrack_l3proto_ipv4.c
index 5bc9f64d7b5b06f9bf1d5a2d8c3923f6fdaccfb9..0af803df82b02ef645704099ea4d6f02b6d37701 100644 (file)
@@ -14,7 +14,6 @@
  * Derived from net/ipv4/netfilter/ip_conntrack_standalone.c
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/ip.h>
 #include <linux/netfilter.h>
@@ -145,7 +144,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);
@@ -348,6 +347,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
                        .tuple.dst.u.tcp.port;
                sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL]
                        .tuple.dst.u3.ip;
+               memset(sin.sin_zero, 0, sizeof(sin.sin_zero));
 
                DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n",
                       NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port));