[BRIDGE]: if no STP then forward all BPDUs
authorStephen Hemminger <shemminger@linux-foundation.org>
Thu, 26 Apr 2007 05:07:58 +0000 (22:07 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:30:02 +0000 (22:30 -0700)
If a bridge is not running STP, then it has no way to detect a cycle
in the network. But if it is not running STP and some other machine
or device is running STP, then if STP BPDU's get forwarded to it can
detect the cycle.

This is how the old 2.4 and early 2.6 code worked.

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

index 5662567c8aed112722c0163a8e9a32e639ea1b8b..420bbb9955e93fa2480393292e7b2705d1cc7a28 100644 (file)
@@ -136,8 +136,14 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
                if (skb->protocol == htons(ETH_P_PAUSE))
                        goto drop;
 
-               return (NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
-                               NULL, br_handle_local_finish) == 0) ? skb : NULL;
+               /* Process STP BPDU's through normal netif_receive_skb() path */
+               if (p->br->stp_enabled != BR_NO_STP) {
+                       if (NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
+                                   NULL, br_handle_local_finish))
+                               return NULL;
+                       else
+                               return skb;
+               }
        }
 
        switch (p->state) {