patch-2.4.1 linux/net/core/netfilter.c

Next file: linux/net/decnet/Makefile
Previous file: linux/net/bridge/br_private.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0/linux/net/core/netfilter.c linux/net/core/netfilter.c
@@ -442,7 +442,6 @@
 	}
 }
 
-/* We have BR_NETPROTO_LOCK here */
 int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
 		 struct net_device *indev,
 		 struct net_device *outdev,
@@ -452,6 +451,9 @@
 	unsigned int verdict;
 	int ret = 0;
 
+	/* We may already have this, but read-locks nest anyway */
+	br_read_lock_bh(BR_NETPROTO_LOCK);
+
 #ifdef CONFIG_NETFILTER_DEBUG
 	if (skb->nf_debug & (1 << hook)) {
 		printk("nf_hook: hook %i already set.\n", hook);
@@ -479,6 +481,7 @@
 		break;
 	}
 
+	br_read_unlock_bh(BR_NETPROTO_LOCK);
 	return ret;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)