]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ethernet/eth.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[linux-2.6-omap-h63xx.git] / net / ethernet / eth.c
index a80839b02e3f297cff4439cd7385629036cb0165..b9d85af2dd31f290883db91125eb958440ef0c12 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>
 
@@ -129,7 +130,7 @@ int eth_rebuild_header(struct sk_buff *skb)
 
        switch (eth->h_proto) {
 #ifdef CONFIG_INET
-       case __constant_htons(ETH_P_IP):
+       case htons(ETH_P_IP):
                return arp_find(eth->h_dest, skb);
 #endif
        default:
@@ -184,6 +185,17 @@ __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 (netdev_uses_trailer_tags(dev))
+               return htons(ETH_P_TRAILER);
+
        if (ntohs(eth->h_proto) >= 1536)
                return eth->h_proto;