mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[NET]: Validate device addr prior to interface-up
Signed-off-by: Jeff Garzik <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
c9927c2bf4
commit
bada339ba2
3 changed files with 20 additions and 5 deletions
|
|
@ -298,6 +298,14 @@ static int eth_change_mtu(struct net_device *dev, int new_mtu)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int eth_validate_addr(struct net_device *dev)
|
||||
{
|
||||
if (!is_valid_ether_addr(dev->dev_addr))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct header_ops eth_header_ops ____cacheline_aligned = {
|
||||
.create = eth_header,
|
||||
.parse = eth_header_parse,
|
||||
|
|
@ -317,6 +325,7 @@ void ether_setup(struct net_device *dev)
|
|||
|
||||
dev->change_mtu = eth_change_mtu;
|
||||
dev->set_mac_address = eth_mac_addr;
|
||||
dev->validate_addr = eth_validate_addr;
|
||||
|
||||
dev->type = ARPHRD_ETHER;
|
||||
dev->hard_header_len = ETH_HLEN;
|
||||
|
|
|
|||
Loading…
Reference in a new issue