Merge master.kernel.org:/home/rmk/linux-2.6-arm
[pandora-kernel.git] / net / bridge / br_input.c
index 364e0ba..5c18595 100644 (file)
@@ -112,9 +112,9 @@ static int br_handle_local_finish(struct sk_buff *skb)
  */
 static inline int is_link_local(const unsigned char *dest)
 {
-       const u16 *a = (const u16 *) dest;
-       static const u16 *const b = (const u16 *const ) br_group_address;
-       static const u16 m = __constant_cpu_to_be16(0xfff0);
+       __be16 *a = (__be16 *)dest;
+       static const __be16 *b = (const __be16 *)br_group_address;
+       static const __be16 m = __constant_cpu_to_be16(0xfff0);
 
        return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
 }
@@ -131,9 +131,20 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
        if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
                goto drop;
 
-       if (unlikely(is_link_local(dest)))
-               return (NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
-                               NULL, br_handle_local_finish) == 0) ? skb : NULL;
+       if (unlikely(is_link_local(dest))) {
+               /* Pause frames shouldn't be passed up by driver anyway */
+               if (skb->protocol == htons(ETH_P_PAUSE))
+                       goto drop;
+
+               /* 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) {
        case BR_STATE_FORWARDING: