http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=2678
authorMark Huang <mlhuang@cs.princeton.edu>
Thu, 6 Oct 2005 18:53:17 +0000 (18:53 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Thu, 6 Oct 2005 18:53:17 +0000 (18:53 +0000)
- 2.6.12 netfilter: local packets marked as invalid
- PL7714 fix: don't reset conntrack in the ip_output() path

net/ipv4/ip_output.c
net/ipv4/netfilter/ip_conntrack_standalone.c
net/packet/af_packet.c

index 0fe94ef..0318996 100644 (file)
@@ -111,7 +111,6 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb)
 #ifdef CONFIG_NETFILTER_DEBUG
        nf_debug_ip_loopback_xmit(newskb);
 #endif
-       nf_reset(newskb);
        netif_rx(newskb);
        return 0;
 }
@@ -196,14 +195,6 @@ static inline int ip_finish_output2(struct sk_buff *skb)
        nf_debug_ip_finish_output2(skb);
 #endif /*CONFIG_NETFILTER_DEBUG*/
 
-#ifdef CONFIG_BRIDGE_NETFILTER
-       /* bridge-netfilter defers calling some IP hooks to the bridge layer
-        * and still needs the conntrack reference.
-        */
-       if (skb->nf_bridge == NULL)
-#endif
-               nf_reset(skb);
-
        if (hh) {
                int hh_alen;
 
index 83a668c..084d4ef 100644 (file)
@@ -442,6 +442,13 @@ 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,
index 2cd6d29..10a79da 100644 (file)
@@ -274,6 +274,9 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,  struct
        dst_release(skb->dst);
        skb->dst = NULL;
 
+       /* drop conntrack reference */
+       nf_reset(skb);
+
        spkt = (struct sockaddr_pkt*)skb->cb;
 
        skb_push(skb, skb->data-skb->mac.raw);
@@ -523,6 +526,9 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,  struct packe
        dst_release(skb->dst);
        skb->dst = NULL;
 
+       /* drop conntrack reference */
+       nf_reset(skb);
+
        spin_lock(&sk->sk_receive_queue.lock);
        po->stats.tp_packets++;
        __skb_queue_tail(&sk->sk_receive_queue, skb);