]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ethernet/eth.c
[NET] ethernet: Fix first packet goes out with MAC 00:00:00:00:00:00
[linux-2.6-omap-h63xx.git] / net / ethernet / eth.c
index 9890fd97e538b6c9a18efb2ae068e8560d530e4b..c971f14712ec207608dd48d8477516bcb9af054b 100644 (file)
@@ -95,6 +95,12 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
                saddr = dev->dev_addr;
        memcpy(eth->h_source,saddr,dev->addr_len);
 
+       if(daddr)
+       {
+               memcpy(eth->h_dest,daddr,dev->addr_len);
+               return ETH_HLEN;
+       }
+       
        /*
         *      Anyway, the loopback-device should never use this function... 
         */
@@ -105,12 +111,6 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
                return ETH_HLEN;
        }
        
-       if(daddr)
-       {
-               memcpy(eth->h_dest,daddr,dev->addr_len);
-               return ETH_HLEN;
-       }
-       
        return -ETH_HLEN;
 }