[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9ad88163-ba9a-f49d-4327-d25ad97a8041@marvell.com>
Date: Thu, 12 Nov 2020 10:31:11 +0300
From: Igor Russkikh <irusskikh@...vell.com>
To: Anant Thazhemadam <anant.thazhemadam@...il.com>,
Igor Russkikh <Igor.Russkikh@...antia.com>
CC: <linux-usb@...r.kernel.org>, <davem@...emloft.net>,
<netdev@...r.kernel.org>, <andrew@...n.ch>,
Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>
Subject: Re: [EXT] Re: [PATCH v3 net-next 07/21] net: usb: aqc111: Add support
for getting and setting of MAC address
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
Powered by blists - more mailing lists