提交 2ed9926e 编写于 作者: P Patrick McHardy 提交者: David S. Miller

[NET]: Return more appropriate error from eth_validate_addr().

Paul Bolle wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=9923 would have been much easier to
> track down if eth_validate_addr() would somehow complain aloud if an address 
> is invalid. Shouldn't it make at least some noise?

I guess it should return -EADDRNOTAVAIL similar to eth_mac_addr()
when validation fails.
Signed-off-by: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d2dcba61
...@@ -301,7 +301,7 @@ static int eth_change_mtu(struct net_device *dev, int new_mtu) ...@@ -301,7 +301,7 @@ static int eth_change_mtu(struct net_device *dev, int new_mtu)
static int eth_validate_addr(struct net_device *dev) static int eth_validate_addr(struct net_device *dev)
{ {
if (!is_valid_ether_addr(dev->dev_addr)) if (!is_valid_ether_addr(dev->dev_addr))
return -EINVAL; return -EADDRNOTAVAIL;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册