mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
56a16035bb
When we create an L2 loop on a bridge in netns, we will see packets storm
even if STP is enabled.
# unshare -n
# ip link add br0 type bridge
# ip link add veth0 type veth peer name veth1
# ip link set veth0 master br0 up
# ip link set veth1 master br0 up
# ip link set br0 type bridge stp_state 1
# ip link set br0 up
# sleep 30
# ip -s link show br0
2: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether b6:61:98:1c:1c:b5 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped missed mcast
956553768 12861249 0 0 0 12861249 <-. Keep
TX: bytes packets errors dropped carrier collsns | increasing
1027834 11951 0 0 0 0 <-' rapidly
This is because llc_rcv() drops all packets in non-root netns and BPDU
is dropped.
Let's add extack warning when enabling STP in netns.
# unshare -n
# ip link add br0 type bridge
# ip link set br0 type bridge stp_state 1
Warning: bridge: STP does not work in non-root netns.
Note this commit will be reverted later when we namespacify the whole LLC
infra.
Fixes:
|
||
---|---|---|
.. | ||
netfilter | ||
br_arp_nd_proxy.c | ||
br_cfm_netlink.c | ||
br_cfm.c | ||
br_device.c | ||
br_fdb.c | ||
br_forward.c | ||
br_if.c | ||
br_input.c | ||
br_ioctl.c | ||
br_mdb.c | ||
br_mrp_netlink.c | ||
br_mrp_switchdev.c | ||
br_mrp.c | ||
br_mst.c | ||
br_multicast_eht.c | ||
br_multicast.c | ||
br_netfilter_hooks.c | ||
br_netfilter_ipv6.c | ||
br_netlink_tunnel.c | ||
br_netlink.c | ||
br_nf_core.c | ||
br_private_cfm.h | ||
br_private_mcast_eht.h | ||
br_private_mrp.h | ||
br_private_stp.h | ||
br_private_tunnel.h | ||
br_private.h | ||
br_stp_bpdu.c | ||
br_stp_if.c | ||
br_stp_timer.c | ||
br_stp.c | ||
br_switchdev.c | ||
br_sysfs_br.c | ||
br_sysfs_if.c | ||
br_vlan_options.c | ||
br_vlan_tunnel.c | ||
br_vlan.c | ||
br.c | ||
Kconfig | ||
Makefile |