Message ID | 20240905143120.1583460-12-shaojijie@huawei.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Add support of HIBMCGE Ethernet Driver | expand |
diff --git a/net/core/dev.c b/net/core/dev.c index 98bb5f890b88..d6ec91ea8043 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9089,6 +9089,11 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa, return -EOPNOTSUPP; if (sa->sa_family != dev->type) return -EINVAL; + if (ops->ndo_validate_addr) { + err = ops->ndo_validate_addr(dev); + if (err) + return err; + } if (!netif_device_present(dev)) return -ENODEV; err = dev_pre_changeaddr_notify(dev, sa->sa_data, extack);