Commit 6233d7e0 authored by Scott Feldman's avatar Scott Feldman Committed by Jeff Garzik

[E100] Validate updates to MAC address

On Thu, 20 Mar 2003, Scott Feldman wrote:


* Validate updates to MAC address as valid ethernet address.
parent ca1a0f07
......@@ -1140,6 +1140,8 @@ e100_set_mac(struct net_device *dev, void *addr)
int rc = -1;
struct sockaddr *p_sockaddr = (struct sockaddr *) addr;
if (!is_valid_ether_addr(p_sockaddr->sa_data))
return -EADDRNOTAVAIL;
bdp = dev->priv;
if (e100_setup_iaaddr(bdp, (u8 *) (p_sockaddr->sa_data))) {
......@@ -1274,6 +1276,10 @@ e100_init(struct e100_private *bdp)
/* read the MAC address from the eprom */
e100_rd_eaddr(bdp);
if (!is_valid_ether_addr(bdp->device->dev_addr)) {
printk(KERN_ERR "e100: Invalid Ethernet address\n");
return false;
}
/* read NIC's part number */
e100_rd_pwa_no(bdp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment