[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070711173814.18369.53719.sendpatchset@localhost.localdomain>
Date: Wed, 11 Jul 2007 19:38:14 +0200 (MEST)
From: Patrick McHardy <kaber@...sh.net>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, greearb@...delatech.com,
Patrick McHardy <kaber@...sh.net>, xemul@...nvz.org
Subject: [ETH 01/04]: Validate address in eth_mac_addr
[ETH]: Validate address in eth_mac_addr
Signed-off-by: Patrick McHardy <kaber@...sh.net>
---
commit 690fb4dbafa9f60f8cb520d5def544580107b3a4
tree ded62c0fcd8497b5cf9459213e1579cc700abb39
parent 99d24edeb6abc6ca3a0d0fbdb83c664c04403c8c
author Patrick McHardy <kaber@...sh.net> Wed, 11 Jul 2007 19:23:22 +0200
committer Patrick McHardy <kaber@...sh.net> Wed, 11 Jul 2007 19:23:22 +0200
net/ethernet/eth.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 1387e54..12c7657 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;
}
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists