Skip to contentSkip to conversation

PATCH : [Re: [Fwd: [LARTC] broadcast over gre tunnel?]]

PATCH Damion de Soto 1 participant 1 message Oct 13, 2003

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi Guys,

Here is our patch to allow broadcast packets over a GRE tunnel. Hopefully it might be accepted into the source someday.

You need to enabled bridging and GRE tunnels in your kernel. No other options are required. The gre patch determines what type of protocol type to put in the GRE header based on the whether the packet is forwarded from a bridge or not.

To use the patch:

# Create your GRE tunnel
ip tunnel add gre1 mode gre remote 10.4.4.1 local 10.4.4.2 ifconfig gre1 up

# Bring the ethernet device up
ifconfig eth1 up

#create the bridge and add the devices:
brctl addbr br0
brctl addif br0 gre1
brctl addif br0 eth1

ifconfig br0 10.4.1.1 netmask 255.255.255.0 broadcast 10.4.1.255

regards

Signature · 7 lines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Damion de Soto - Software Engineer  email:     [email protected]
SnapGear ---                           ph:         +61 7 3435 2809
 | Custom Embedded Solutions          fax:         +61 7 3891 3630
 | and Security Appliances            web: http://www.snapgear.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ---  Free Embedded Linux Distro at   http://www.snapgear.org  ---
include/linux/if_tunnel.h +2 -0
diff -ru linux-2.4.22/include/linux/if_tunnel.h linux-2.4.22.patched/include/linux/if_tunnel.h
@@ -15,6 +15,8 @@
 #define GRE_FLAGS	__constant_htons(0x00F8)
 #define GRE_VERSION	__constant_htons(0x0007)
 
+#define GRE_P_ETH_BR	__constant_htons(0x6558)
+
 struct ip_tunnel_parm
 {
 	char			name[IFNAMSIZ];
net/bridge/br_if.c +2 -0
diff -ru linux-2.4.22/net/bridge/br_if.c linux-2.4.22.patched/net/bridge/br_if.c
@@ -226,8 +226,10 @@
 	if (dev->br_port != NULL)
 		return -EBUSY;
 
+#if 0
 	if (dev->flags & IFF_LOOPBACK || dev->type != ARPHRD_ETHER)
 		return -EINVAL;
+#endif
 
 	if (dev->hard_start_xmit == br_dev_xmit)
 		return -ELOOP;
net/ipv4/ip_gre.c +177 -46

313 lines not on this page · raw message