diff options
Diffstat (limited to 'net/ethernet/eth.c')
-rw-r--r-- | net/ethernet/eth.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index ed8a3d49487d..6b2e454ae313 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
@@ -298,6 +298,14 @@ static int eth_change_mtu(struct net_device *dev, int new_mtu) | |||
298 | return 0; | 298 | return 0; |
299 | } | 299 | } |
300 | 300 | ||
301 | static int eth_validate_addr(struct net_device *dev) | ||
302 | { | ||
303 | if (!is_valid_ether_addr(dev->dev_addr)) | ||
304 | return -EINVAL; | ||
305 | |||
306 | return 0; | ||
307 | } | ||
308 | |||
301 | const struct header_ops eth_header_ops ____cacheline_aligned = { | 309 | const struct header_ops eth_header_ops ____cacheline_aligned = { |
302 | .create = eth_header, | 310 | .create = eth_header, |
303 | .parse = eth_header_parse, | 311 | .parse = eth_header_parse, |
@@ -317,6 +325,7 @@ void ether_setup(struct net_device *dev) | |||
317 | 325 | ||
318 | dev->change_mtu = eth_change_mtu; | 326 | dev->change_mtu = eth_change_mtu; |
319 | dev->set_mac_address = eth_mac_addr; | 327 | dev->set_mac_address = eth_mac_addr; |
328 | dev->validate_addr = eth_validate_addr; | ||
320 | 329 | ||
321 | dev->type = ARPHRD_ETHER; | 330 | dev->type = ARPHRD_ETHER; |
322 | dev->hard_header_len = ETH_HLEN; | 331 | dev->hard_header_len = ETH_HLEN; |