提交 ff593c59 编写于 作者: D Denis Vlasenko 提交者: David S. Miller

[NET]: Micro optimization in eth_header()

Signed-off-by: NDenis Vlasenko <vda@ilport.com.ua>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7fe40f73
......@@ -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...
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册