]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ethernet/eth.c
dsa: add support for original DSA tagging format
[linux-2.6-omap-h63xx.git] / net / ethernet / eth.c
index 647a9edee375906094d3f5df825fa1f5c69637d0..dae47e7a44d82c0edf779a7827186f84d96849e8 100644 (file)
@@ -57,6 +57,7 @@
 #include <net/sock.h>
 #include <net/ipv6.h>
 #include <net/ip.h>
+#include <net/dsa.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
@@ -184,6 +185,15 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
                        skb->pkt_type = PACKET_OTHERHOST;
        }
 
+       /*
+        * Some variants of DSA tagging don't have an ethertype field
+        * at all, so we check here whether one of those tagging
+        * variants has been configured on the receiving interface,
+        * and if so, set skb->protocol without looking at the packet.
+        */
+       if (netdev_uses_dsa_tags(dev))
+               return htons(ETH_P_DSA);
+
        if (ntohs(eth->h_proto) >= 1536)
                return eth->h_proto;