summaryrefslogtreecommitdiffstats
path: root/net/ethernet
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-07-12 04:41:18 +0200
committerDavid S. Miller <davem@davemloft.net>2007-07-12 04:41:18 +0200
commit71bffe556c59a7865bf0b1ecd94530f1e296cdb0 (patch)
tree936bca47c59179b81b2a0ddd7ef731a196aeb97d /net/ethernet
parentMerge master.kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6 (diff)
downloadlinux-71bffe556c59a7865bf0b1ecd94530f1e296cdb0.tar.xz
linux-71bffe556c59a7865bf0b1ecd94530f1e296cdb0.zip
[ETH]: Validate address in eth_mac_addr
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethernet')
-rw-r--r--net/ethernet/eth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 1387e5411f77..12c765715acf 100644
--- 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;
}