lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1411573940-14079-6-git-send-email-ahmed@gandi.net>
Date:	Wed, 24 Sep 2014 17:52:01 +0200
From:	Ahmed Amamou <ahmed@...di.net>
To:	netdev@...r.kernel.org
Cc:	william@...di.net, f.cachereul@...halink.fr,
	Ahmed Amamou <ahmed@...di.net>,
	Kamel Haddadou <kamel@...di.net>
Subject: [RFC PATCH 05/24] net: rbridge: Adapt Bridge structure

change bridge structure to add corresponding RBridge reference
change bridge port structure to identify disable /P2P/ ACCESS / TRUNK port/

Signed-off-by: Ahmed Amamou <ahmed@...di.net>
Signed-off-by: Kamel Haddadou <kamel@...di.net>
Signed-off-by: François Cachereul <f.cachereul@...halink.fr>
---
 include/linux/etherdevice.h | 34 ++++++++++++++++++++++++++++++++++
 net/bridge/br_private.h     | 25 +++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 9c5529d..09dc18c 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -54,6 +54,16 @@ struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
 /* Reserved Ethernet Addresses per IEEE 802.1Q */
 static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
 { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
+#ifdef CONFIG_TRILL
+static const u8 eth_reserved_addr_all_rbridge[ETH_ALEN] __aligned(2) = {
+0x01, 0x80, 0xc2, 0x00, 0x00, 0x40};
+
+static const u8 eth_reserved_addr_isis_rbridge[ETH_ALEN] __aligned(2) = {
+0x01, 0x80, 0xc2, 0x00, 0x00, 0x41};
+
+static const u8 eth_reserved_addr_esadi_rbridge[ETH_ALEN] __aligned(2) = {
+0x01, 0x80, 0xc2, 0x00, 0x00, 0x42};
+#endif
 
 /**
  * is_link_local_ether_addr - Determine if given Ethernet address is link-local
@@ -391,4 +401,28 @@ static inline unsigned long compare_ether_header(const void *a, const void *b)
 #endif
 }
 
+#ifdef CONFIG_TRILL
+/**
+ * is_all_rbr_address - check if it is a specific Rbridge brodcast mac address
+ * @addr1: Pointer to a six-byte array containing the Ethernet address
+ *
+ * returns true if it is a RBridge brodcast address 01:80:C2:00:00:40
+ */
+static inline bool is_all_rbr_address(const u8 * addr1)
+{
+	return ether_addr_equal(addr1, eth_reserved_addr_all_rbridge);
+}
+
+static inline bool is_isis_rbr_address(const u8 * addr1)
+{
+	return ether_addr_equal(addr1, eth_reserved_addr_isis_rbridge);
+}
+
+static inline bool is_esadi_rbr_address(const u8 * addr1)
+{
+	return ether_addr_equal(addr1, eth_reserved_addr_esadi_rbridge);
+}
+#endif
+
+
 #endif	/* _LINUX_ETHERDEVICE_H */
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 62a7fa2..430c556 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -19,6 +19,9 @@
 #include <linux/u64_stats_sync.h>
 #include <net/route.h>
 #include <linux/if_vlan.h>
+#ifdef CONFIG_TRILL
+#include "rbridge/rbr_private.h"
+#endif
 
 #define BR_HASH_BITS 8
 #define BR_HASH_SIZE (1 << BR_HASH_BITS)
@@ -31,6 +34,18 @@
 
 #define BR_VERSION	"2.3"
 
+#ifdef CONFIG_TRILL
+  /* TRILL flagged ports are ports where we expect receiving native layer 2 frames
+   */
+#define TRILL_FLAG_DISABLE	0x1
+#define TRILL_FLAG_P2P		0x2
+#define TRILL_FLAG_ACCESS	0x4
+#define TRILL_FLAG_TRUNK	0x8	/* DROP ALL native L2 frame */
+/* Bridge TRILL state */
+#define BR_NO_TRILL			0	/* no trill  */
+#define BR_TRILL			1	/* trill enabled */
+#endif
+
 /* Control of forwarding link local multicast */
 #define BR_GROUPFWD_DEFAULT	0
 /* Don't allow forwarding control protocols like STP and LLDP */
@@ -163,6 +178,11 @@ struct net_bridge_port
 	struct rcu_head			rcu;
 
 	unsigned long 			flags;
+	/* Trill */
+#ifdef CONFIG_TRILL
+	uint8_t					trill_flag;
+#endif /* CONFIG_TRILL */
+
 #define BR_HAIRPIN_MODE		0x00000001
 #define BR_BPDU_GUARD           0x00000002
 #define BR_ROOT_BLOCK		0x00000004
@@ -252,6 +272,11 @@ struct net_bridge
 		BR_USER_STP,		/* new RSTP in userspace */
 	} stp_enabled;
 
+#ifdef CONFIG_TRILL
+	bool	 				trill_enabled;
+	struct rbr              *rbr;
+#endif
+
 	unsigned char			topology_change;
 	unsigned char			topology_change_detected;
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ