[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070619130826.26769.24481.sendpatchset@localhost.localdomain>
Date: Tue, 19 Jun 2007 15:08:43 +0200 (MEST)
From: Patrick McHardy <kaber@...sh.net>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, Patrick McHardy <kaber@...sh.net>
Subject: [ETHERNET 01/02]: Validate new address in eth_mac_addr
[ETHERNET]: Validate new address in eth_mac_addr
Signed-off-by: Patrick McHardy <kaber@...sh.net>
---
commit c92ac42cd3badaf120e97223ac4798abf5226424
tree 824d080a4748fcd6f025bbe7b9466feee46e3303
parent 45da27ba265dba3c740c45d47f584c30d7066f82
author Patrick McHardy <kaber@...sh.net> Mon, 18 Jun 2007 16:15:32 +0200
committer Patrick McHardy <kaber@...sh.net> Mon, 18 Jun 2007 16:15:32 +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 0ac2524..9298a2c 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 -EINVAL;
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