Re: [PATCH V9 net-next 11/11] net: add ndo_validate_addr check in dev_set_mac_address

From: Jijie Shao
Date: Tue Sep 10 2024 - 10:01:59 EST



on 2024/9/10 16:39, Kalesh Anakkur Purayil wrote:
On Tue, Sep 10, 2024 at 1:36 PM Jijie Shao <shaojijie@xxxxxxxxxx> wrote:
+++ b/net/core/dev.c
@@ -9087,6 +9087,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;
+ }
[Kalesh] It would be better to move this code after
netif_device_present() check. Minor nit and there will not be any
functional impact.

Yes, You are right,
For other reasons I need to send v10, I will move it.

Thanks,
Jijie Shao