]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ethernet/eth.c
[SCTP]: Return socket errors only if the receive queue is empty.
[linux-2.6-omap-h63xx.git] / net / ethernet / eth.c
index 87a052a9a84f9b4025ebf430f0c6197afd3a759c..e245773672749880e6b9a4bf28a36abd39a9081a 100644 (file)
@@ -158,16 +158,15 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
        struct ethhdr *eth;
        unsigned char *rawp;
        
-       skb->mac.raw=skb->data;
+       skb->mac.raw = skb->data;
        skb_pull(skb,ETH_HLEN);
        eth = eth_hdr(skb);
        
-       if(*eth->h_dest&1)
-       {
-               if(memcmp(eth->h_dest,dev->broadcast, ETH_ALEN)==0)
-                       skb->pkt_type=PACKET_BROADCAST;
+       if (*eth->h_dest&1) {
+               if (!compare_ether_addr(eth->h_dest, dev->broadcast))
+                       skb->pkt_type = PACKET_BROADCAST;
                else
-                       skb->pkt_type=PACKET_MULTICAST;
+                       skb->pkt_type = PACKET_MULTICAST;
        }
        
        /*
@@ -178,10 +177,9 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
         *      seems to set IFF_PROMISC.
         */
         
-       else if(1 /*dev->flags&IFF_PROMISC*/)
-       {
-               if(memcmp(eth->h_dest,dev->dev_addr, ETH_ALEN))
-                       skb->pkt_type=PACKET_OTHERHOST;
+       else if(1 /*dev->flags&IFF_PROMISC*/) {
+               if (unlikely(compare_ether_addr(eth->h_dest, dev->dev_addr)))
+                       skb->pkt_type = PACKET_OTHERHOST;
        }
        
        if (ntohs(eth->h_proto) >= 1536)