projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50b65cc
)
[ETH]: Validate address in eth_mac_addr
author
Patrick McHardy
<kaber@trash.net>
Thu, 12 Jul 2007 02:41:18 +0000
(19:41 -0700)
committer
David S. Miller
<davem@davemloft.net>
Thu, 12 Jul 2007 02:41:18 +0000
(19:41 -0700)
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethernet/eth.c
patch
|
blob
|
blame
|
history
diff --git
a/net/ethernet/eth.c
b/net/ethernet/eth.c
index 1387e5411f77e4ee8b8b47ff35ae001c7624f4cf..12c765715acfdb102314ebc663d8de1bdbbb0fee 100644
(file)
--- a/
net/ethernet/eth.c
+++ b/
net/ethernet/eth.c
@@
-266,8
+266,11
@@
void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev,
static int eth_mac_addr(struct net_device *dev, void *p)
{
struct sockaddr *addr = p;
+
if (netif_running(dev))
return -EBUSY;
+ if (!is_valid_ether_addr(addr->sa_data))
+ return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
return 0;
}