Re: [Ebtables-user] VLAN and bridge with ebtables, kernel panic

Bart De Schuymer <[email protected]>
Newsgroups gmane.linux.network.bridge.ebtables.devel,gmane.linux.network.bridge.ebtables.user
Message-ID <[email protected]>
On Friday 15 August 2003 09:31, Pavel Levshin wrote:
> Maybe this configuration (I mean, vlan over bridge) is of little use, but
> it works without ebtables, so there is a bug.

Could you - others shouldn't be shy either - try the following incremental
patch? It should remove the bug appearing when tagging a bridge device.

cheers,
Bart

--- linux-2.4.21-patched/net/netsyms.c.old	Sat Aug 23 19:50:11 2003
+++ linux-2.4.21-patched/net/netsyms.c	Sat Aug 23 20:13:01 2003
@@ -229,6 +229,11 @@ EXPORT_SYMBOL(scm_detach_fds);
 
 #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
 EXPORT_SYMBOL(br_handle_frame_hook);
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if defined(CONFIG_INET) && defined(CONFIG_NETFILTER)
+EXPORT_SYMBOL(vlan_dev_hard_start_xmit_p);
+#endif
+#endif
 #ifdef CONFIG_INET
 EXPORT_SYMBOL(br_ioctl_hook);
 #endif
--- linux-2.4.21-patched/net/core/dev.c.old	Sat Aug 23 21:05:43 2003
+++ linux-2.4.21-patched/net/core/dev.c	Sat Aug 23 20:13:55 2003
@@ -1425,6 +1425,13 @@ static void net_tx_action(struct softirq
 
 #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
 int (*br_handle_frame_hook)(struct sk_buff *skb) = NULL;
+
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if defined(CONFIG_INET) && defined(CONFIG_NETFILTER)
+/* net/bridge/br_netfilter.c needs the address of lan_dev_hard_start_xmit */
+int (*vlan_dev_hard_start_xmit_p)(struct sk_buff *skb, struct net_device dev);
+#endif
+#endif
 #endif
 
 static __inline__ int handle_bridge(struct sk_buff *skb,
--- linux-2.4.21-patched/net/bridge/br_netfilter.c.old	Sat Aug 23 21:34:42 2003
+++ linux-2.4.21-patched/net/bridge/br_netfilter.c	Sat Aug 23 21:34:37 2003
@@ -20,6 +20,7 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <linux/if_ether.h>
+#include <linux/if_vlan.h>
 #include <linux/netfilter_bridge.h>
 #include <linux/netfilter_ipv4.h>
 #include <linux/in_route.h>
@@ -533,10 +534,15 @@ static unsigned int ipv4_sabotage_out(un
    const struct net_device *in, const struct net_device *out,
    int (*okfn)(struct sk_buff *))
 {
-	if (out->hard_start_xmit == br_dev_xmit &&
+	if ((out->hard_start_xmit == br_dev_xmit &&
 	    okfn != br_nf_forward_finish &&
 	    okfn != br_nf_local_out_finish &&
-	    okfn != br_dev_queue_push_xmit) {
+	    okfn != br_dev_queue_push_xmit)
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+	    || (out->hard_start_xmit == vlan_dev_hard_start_xmit_p &&
+	    VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit)
+#endif
+	    ) {
 		struct sk_buff *skb = *pskb;
 		struct nf_bridge_info *nf_bridge;
 
--- linux-2.4.21-patched/net/8021q/vlan.c.old	Sat Aug 23 19:50:34 2003
+++ linux-2.4.21-patched/net/8021q/vlan.c	Sat Aug 23 20:15:53 2003
@@ -104,6 +104,12 @@ static int __init vlan_proto_init(void)
 
 	vlan_ioctl_hook = vlan_ioctl_handler;
 
+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
+#if defined(CONFIG_INET) && defined(CONFIG_NETFILTER)
+	vlan_dev_hard_start_xmit_p = vlan_dev_hard_start_xmit;
+#endif
+#endif
+
 	return 0;
 }
 
@@ -129,6 +135,11 @@ static void __exit vlan_cleanup_module(v
 	dev_remove_pack(&vlan_packet_type);
 	vlan_proc_cleanup();
 	vlan_ioctl_hook = NULL;
+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
+#if defined(CONFIG_INET) && defined(CONFIG_NETFILTER)
+	vlan_dev_hard_start_xmit_p = NULL;
+#endif
+#endif
 }
 
 module_init(vlan_proto_init);
--- linux-2.4.21-patched/include/linux/if_vlan.h.old	Sat Aug 23 19:50:43 2003
+++ linux-2.4.21-patched/include/linux/if_vlan.h	Sat Aug 23 21:10:26 2003
@@ -57,6 +57,13 @@ struct vlan_hdr {
 /* found in af_inet.c */
 extern int (*vlan_ioctl_hook)(unsigned long arg);
 
+#if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE)
+#if defined(CONFIG_INET) && defined(CONFIG_NETFILTER)
+/* found in net/core/dev.c */
+extern int (*vlan_dev_hard_start_xmit_p)(struct sk_buff *skb, struct net_device *dev);
+#endif
+#endif
+
 #define VLAN_NAME "vlan"
 
 /* if this changes, algorithm will have to be reworked because this



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.