lkml.org 
[lkml]   [2012]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 37/50] usbnet: set addr_assign_type if random_ether_addr() used
Date
On Mittwoch, 8. Februar 2012, Oliver Neukum wrote:
> Am Mittwoch, 8. Februar 2012, 22:10:44 schrieb Danny Kukawka:
> > Set addr_assign_type correctly to NET_ADDR_RANDOM in case
> > a random MAC address was generated and assigned to the netdevice.
> >
> > Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
> > ---
> > drivers/net/usb/usbnet.c | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> > index fae0fbd..7bd07d7 100644
> > --- a/drivers/net/usb/usbnet.c
> > +++ b/drivers/net/usb/usbnet.c
> > @@ -1365,6 +1365,7 @@ usbnet_probe (struct usb_interface *udev, const
> > struct usb_device_id *prod) dev->net = net;
> > strcpy (net->name, "usb%d");
> > memcpy (net->dev_addr, node_id, sizeof node_id);
> > + net->addr_assign_type |= NET_ADDR_RANDOM;
> >
> > /* rx and tx sides can use different message sizes;
> > * bind() should set rx_urb_size in that case.
>
> Don't you set the flag too early here? By that time we don't know
> whether the device provides a real MAC, do we?

You're right. Maybe it's the wrong place. Better the drivers take care of
setting the correct addr_assign_type.

Danny


\
 
 \ /
  Last update: 2012-02-08 22:45    [W:0.089 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site