mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[NET]: Micro optimization in eth_header()
Signed-off-by: Denis Vlasenko <vda@ilport.com.ua> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7fe40f73d7
commit
ff593c592a
1 changed files with 3 additions and 4 deletions
|
@ -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...
|
||||
|
|
Loading…
Reference in a new issue