Skip to contentSkip to conversation

net/ipv4/ip_gre: Ethernet multipoint GRE over IP

PATCH Superseded Stefan Gula 1 participant 1 message Jan 25, 2012

Subsystems (3)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 net/ipv4/ip_gre: Ethernet multipoint GRE over IP

From: Stefan Gula <[email protected]>

This patch is an extension for current Ethernet over GRE implementation, which allows user to create virtual bridge (multipoint VPN) and forward traffic based on Ethernet MAC address information in it. It simulates the Bridge behavior learning mechanism, but instead of learning port ID from which given MAC address comes, it learns IP address of peer which encapsulated given packet. Multicast, Broadcast and unknown-multicast traffic is send over network as multicast encapsulated GRE packet, so one Ethernet multipoint GRE tunnel can be represented as one single virtual switch on logical level and be also represented as one multicast IPv4 address on network level.

---

V5 changes: created ipgre_tap_bridge_rcv function to make code somehow more readable

include/net/ipip.h +8 -0
diff -uprN -X linux-3.2.1-orig/Documentation/dontdiff linux-3.2.1-orig/include/net/ipip.h linux-3.2.1-my/include/net/ipip.h
@@ -27,6 +27,14 @@ struct ip_tunnel {
 	__u32			o_seqno;	/* The last output seqno */
 	int			hlen;		/* Precalculated GRE header length */
 	int			mlink;
+#ifdef CONFIG_NET_IPGRE_BRIDGE
+#define GRETAP_BR_HASH_BITS 8
+#define GRETAP_BR_HASH_SIZE (1 << GRETAP_BR_HASH_BITS)
+	struct hlist_head	hash[GRETAP_BR_HASH_SIZE];
+	spinlock_t		hash_lock;
+	unsigned long		ageing_time;
+	struct timer_list	gc_timer;
+#endif
 
 	struct ip_tunnel_parm	parms;
 
net/ipv4/Kconfig +9 -0
diff -uprN -X linux-3.2.1-orig/Documentation/dontdiff linux-3.2.1-orig/net/ipv4/Kconfig linux-3.2.1-my/net/ipv4/Kconfig
@@ -211,6 +211,15 @@ config NET_IPGRE_BROADCAST
 	  Network), but can be distributed all over the Internet. If you want
 	  to do that, say Y here and to "IP multicast routing" below.
 
+config NET_IPGRE_BRIDGE
+	bool "IP: Ethernet over multipoint GRE over IP"
+	depends on IP_MULTICAST && NET_IPGRE && NET_IPGRE_BROADCAST
+	help
+	  Allows you to use multipoint GRE VPN as virtual switch and interconnect
+	  several L2 endpoints over L3 routed infrastructure. It is useful for
+	  creating multipoint L2 VPNs which can be later used inside bridge
+	  interfaces If you want to use. GRE multipoint L2 VPN feature say Y.
+
 config IP_MROUTE
 	bool "IP: multicast routing"
 	depends on IP_MULTICAST
net/ipv4/ip_gre.c +243 -2

311 lines not on this page · raw message