Re: [EXT] Re: [PATCH v3 net-next 07/21] net: usb: aqc111: Add support for getting and setting of MAC address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Anant,

>>
>> +static int aqc111_set_mac_addr(struct net_device *net, void *p)
>> +{
>> +	struct usbnet *dev = netdev_priv(net);
>> +	int ret = 0;
>> +
>> +	ret = eth_mac_addr(net, p);
>> +	if (ret < 0)
>> +		return ret;
>> +
> 
> When eth_mac_addr() fails, from what I can see, it returns either -EBUSY, or
> -EADDRNOTAVAIL.
> Wouldn't it be a better idea to set a random MAC address instead, when
> -EADDRNOTAVAIL is returned, so that the interface still comes up and is
> usable?
> 
> I'm only asking because this feels similar to the discussion that can be 
> found here.
>     https://urldefense.proofpoint.com/v2/url?u=https-3A__lkml.org_lkml_2020_10_2_305&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=3kUjVPjrPMvlbd3rzgP63W0eewvCq4D-kzQRqaXHOqU&m=aJdSTt0SmQpKGqrsMm9TQ2mCWDH1Vc7arUp0xq-v6Ac&s=n-tXDyWIR5tPvrQ4DUasDgrocxKU3e_A-mh3Nv5JC5A&e=

Here in set_mac_addr driver is being asked to SET the specified mac.
If it fails - device will most probably drop the packets designated for it.

So I think no, you can't put here some random MAC.

Regards,
  Igor



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux