net: slightly optimize eth_type_trans
[linux-2.6-microblaze.git] / net / ethernet / eth.c
index fd8faa0..58933fa 100644 (file)
@@ -165,15 +165,17 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
        eth = (struct ethhdr *)skb->data;
        skb_pull_inline(skb, ETH_HLEN);
 
-       if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) {
-               if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
-                       skb->pkt_type = PACKET_BROADCAST;
-               else
-                       skb->pkt_type = PACKET_MULTICAST;
+       if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
+                                             dev->dev_addr))) {
+               if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) {
+                       if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
+                               skb->pkt_type = PACKET_BROADCAST;
+                       else
+                               skb->pkt_type = PACKET_MULTICAST;
+               } else {
+                       skb->pkt_type = PACKET_OTHERHOST;
+               }
        }
-       else if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
-                                                  dev->dev_addr)))
-               skb->pkt_type = PACKET_OTHERHOST;
 
        /*
         * Some variants of DSA tagging don't have an ethertype field