netdev
[Top] [All Lists]

[PATCH]: forgotten dev_put for bridge-devices in nf_reinject

To: Netfilter Development Mailinglist <netfilter-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [PATCH]: forgotten dev_put for bridge-devices in nf_reinject
From: Patrick McHardy <kaber@xxxxxxxxx>
Date: Tue, 10 Dec 2002 14:35:58 +0100
Cc: netdev@xxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021208 Debian/1.2.1-2
Hi.

The attached patch releases the bridge devices grabbed in nf_queue after reinjecting the packet.
Seems someone forgot these (or planned to get Rusty killed) ;)

Bye,
Patrick
--- linux-2.5.50/net/core/netfilter.c.orig      2002-12-10 14:16:20.000000000 
+0100
+++ linux-2.5.50/net/core/netfilter.c   2002-12-10 14:19:23.000000000 +0100
@@ -574,7 +574,15 @@
        /* Release those devices we held, or Alexey will kill me. */
        if (info->indev) dev_put(info->indev);
        if (info->outdev) dev_put(info->outdev);
-       
+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
+       if (skb->nf_bridge) {
+               if (skb->nf_bridge->physindev)
+                       dev_put(skb->nf_bridge->physindev);
+               if (skb->nf_bridge->physoutdev)
+                       dev_put(skb->nf_bridge->physoutdev);
+       }
+#endif
+
        kfree(info);
        return;
 }
<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH]: forgotten dev_put for bridge-devices in nf_reinject, Patrick McHardy <=