Message ID | 20091204115138.GA5532@coldcone |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: "Denis Kirjanov <kirjanov@gmail.com" <kirjanov@gmail.com> Date: Fri, 4 Dec 2009 14:51:38 +0300 > Check for valid hw address. > > Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Assuming we don't accept your other patch this needs to return -EINVAL. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 796a493..0b85501 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -1827,6 +1827,9 @@ static int mv643xx_eth_set_mac_address(struct net_device *dev, void *addr) { struct sockaddr *sa = addr; + if (!is_valid_ether_addr(sa->sa_data)) + return -EADDRNOTAVAIL; + memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN); netif_addr_lock_bh(dev);
Check for valid hw address. Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> --- drivers/net/mv643xx_eth.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html