Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bridge: change BR_GROUPFWD_RESTRICTED to allow forwarding of LLDP frames

BR_GROUPFWD_RESTRICTED bitmask restricts users from setting values to
/sys/class/net/brX/bridge/group_fwd_mask that allow forwarding of
some IEEE 802.1D Table 7-10 Reserved addresses:

(MAC Control) 802.3 01-80-C2-00-00-01
(Link Aggregation) 802.3 01-80-C2-00-00-02
802.1AB LLDP 01-80-C2-00-00-0E

Change BR_GROUPFWD_RESTRICTED to allow to forward LLDP frames and document
group_fwd_mask.

e.g.
echo 16384 > /sys/class/net/brX/bridge/group_fwd_mask
allows to forward LLDP frames.

This may be needed for bridge setups used for network troubleshooting or
any other scenario where forwarding of LLDP frames is desired (e.g. bridge
connecting a virtual machine to real switch transmitting LLDP frames that
virtual machine needs to receive).

Tested on a simple bridge setup with two interfaces and host transmitting
LLDP frames on one side of this bridge (used lldpd). Setting group_fwd_mask
as described above lets LLDP frames traverse bridge.

Signed-off-by: Bernhard Thaler <bernhard.thaler@wvnet.at>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Bernhard Thaler and committed by
David S. Miller
784b58a3 cd8ae852

+21 -2
+19
Documentation/ABI/testing/sysfs-class-net
··· 39 39 Format is a string, e.g: 00:11:22:33:44:55 for an Ethernet MAC 40 40 address. 41 41 42 + What: /sys/class/net/<bridge iface>/bridge/group_fwd_mask 43 + Date: January 2012 44 + KernelVersion: 3.2 45 + Contact: netdev@vger.kernel.org 46 + Description: 47 + Bitmask to allow forwarding of link local frames with address 48 + 01-80-C2-00-00-0X on a bridge device. Only values that set bits 49 + not matching BR_GROUPFWD_RESTRICTED in net/bridge/br_private.h 50 + allowed. 51 + Default value 0 does not forward any link local frames. 52 + 53 + Restricted bits: 54 + 0: 01-80-C2-00-00-00 Bridge Group Address used for STP 55 + 1: 01-80-C2-00-00-01 (MAC Control) 802.3 used for MAC PAUSE 56 + 2: 01-80-C2-00-00-02 (Link Aggregation) 802.3ad 57 + 58 + Any values not setting these bits can be used. Take special 59 + care when forwarding control frames e.g. 802.1X-PAE or LLDP. 60 + 42 61 What: /sys/class/net/<iface>/broadcast 43 62 Date: April 2005 44 63 KernelVersion: 2.6.12
+2 -2
net/bridge/br_private.h
··· 33 33 34 34 /* Control of forwarding link local multicast */ 35 35 #define BR_GROUPFWD_DEFAULT 0 36 - /* Don't allow forwarding control protocols like STP and LLDP */ 37 - #define BR_GROUPFWD_RESTRICTED 0x4007u 36 + /* Don't allow forwarding of control protocols like STP, MAC PAUSE and LACP */ 37 + #define BR_GROUPFWD_RESTRICTED 0x0007u 38 38 /* The Nearest Customer Bridge Group Address, 01-80-C2-00-00-[00,0B,0C,0D,0F] */ 39 39 #define BR_GROUPFWD_8021AD 0xB801u 40 40