Skip to content

Commit

Permalink
[NET]: Micro optimization in eth_header()
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Vlasenko <vda@ilport.com.ua>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Denis Vlasenko authored and David S. Miller committed Jun 28, 2005
1 parent 7fe40f7 commit ff593c5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/ethernet/eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
* Set the source hardware address.
*/

if(saddr)
memcpy(eth->h_source,saddr,dev->addr_len);
else
memcpy(eth->h_source,dev->dev_addr,dev->addr_len);
if(!saddr)
saddr = dev->dev_addr;
memcpy(eth->h_source,saddr,dev->addr_len);

/*
* Anyway, the loopback-device should never use this function...
Expand Down

0 comments on commit ff593c5

Please sign in to comment.