[ETH]: Validate address in eth_mac_addr

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

---
commit 690fb4dbafa9f60f8cb520d5def544580107b3a4
tree ded62c0fcd8497b5cf9459213e1579cc700abb39
parent 99d24edeb6abc6ca3a0d0fbdb83c664c04403c8c
author Patrick McHardy <[EMAIL PROTECTED]> Wed, 11 Jul 2007 19:23:22 +0200
committer Patrick McHardy <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to