]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[NETFILTER]: Drop conntrack reference when packet leaves IP
authorPatrick McHardy <kaber@trash.net>
Mon, 25 Apr 2005 19:01:07 +0000 (12:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Apr 2005 19:01:07 +0000 (12:01 -0700)
In the event a raw socket is created for sending purposes only, the creator
never bothers to check the socket's receive queue.  But we continue to
add skbs to its queue until it fills up.

Unfortunately, if ip_conntrack is loaded on the box, each skb we add to the
queue potentially holds a reference to a conntrack.  If the user attempts
to unload ip_conntrack, we will spin around forever since the queued skbs
are pinned.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c
net/ipv4/netfilter/ip_conntrack_standalone.c

index 30ab7b6ab7618709b2f9cb39dd8a9180b29f3820..38f69532a029e5ff1ddbdbd665afcff46e94abb5 100644 (file)
@@ -195,6 +195,8 @@ static inline int ip_finish_output2(struct sk_buff *skb)
        nf_debug_ip_finish_output2(skb);
 #endif /*CONFIG_NETFILTER_DEBUG*/
 
+       nf_reset(skb);
+
        if (hh) {
                int hh_alen;
 
index 0c29ccf62a897862a70ae135506e11378b2da3e2..46ca45f74d85b6e543304df6eb6f89b9db2098d4 100644 (file)
@@ -431,13 +431,6 @@ static unsigned int ip_conntrack_defrag(unsigned int hooknum,
                                        const struct net_device *out,
                                        int (*okfn)(struct sk_buff *))
 {
-#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
-       /* Previously seen (loopback)?  Ignore.  Do this before
-           fragment check. */
-       if ((*pskb)->nfct)
-               return NF_ACCEPT;
-#endif
-
        /* Gather fragments. */
        if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
                *pskb = ip_ct_gather_frags(*pskb,