[ETHERNET]: Validate new address in eth_mac_addr

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>

---
commit c92ac42cd3badaf120e97223ac4798abf5226424
tree 824d080a4748fcd6f025bbe7b9466feee46e3303
parent 45da27ba265dba3c740c45d47f584c30d7066f82
author Patrick McHardy <[EMAIL PROTECTED]> Mon, 18 Jun 2007 16:15:32 +0200
committer Patrick McHardy <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to