bridge: relay bridge multicast pkgs if !STP
authorStephen Hemminger <shemminger@vyatta.com>
Fri, 15 May 2009 06:10:13 +0000 (06:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 May 2009 04:12:54 +0000 (21:12 -0700)
Currently the bridge catches all STP packets; even if STP is turned
off.  This prevents other systems (which do have STP turned on)
from being able to detect loops in the network.

With this patch, if STP is off, then any packet sent to the STP
multicast group address is forwarded to all ports.

Based on earlier patch by Joakim Tjernlund with changes
to go through forwarding (not local chain), and optimization
that only last octet needs to be checked.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_input.c

index 30b88777c3df1ad3ab934832e8738c6110760d4c..5ee1a3682bf282dc1893e1be3596daba847371f9 100644 (file)
@@ -134,6 +134,10 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
                if (skb->protocol == htons(ETH_P_PAUSE))
                        goto drop;
 
+               /* If STP is turned off, then forward */
+               if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
+                       goto forward;
+
                if (NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
                            NULL, br_handle_local_finish))
                        return NULL;    /* frame consumed by filter */
@@ -141,6 +145,7 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
                        return skb;     /* continue processing */
        }
 
+forward:
        switch (p->state) {
        case BR_STATE_FORWARDING:
                rhook = rcu_dereference(br_should_route_hook);