Subject: Re: [PATCH] dm9601: handle corrupt mac address

From: Peter Korsgaard <[email-masked]>
Date: Tue, 06 Jan 2009 09:42:01 +0100

>>>>> "Wu" == Wu Fengguang <[email-masked]> writes:

Hi,

 >> Do we automatically get a random address in netdev nowadays without
 >> calling random_ether_addr? I didn't know that.

 Wu> I confirmed based on both code review and tests.
 Wu> The logic goes like this in usbnet.c:

 Wu>   80 // randomly generated ethernet address
 Wu>   81 static u8       node_id [ETH_ALEN];
 Wu> ...
 Wu> 1118 int
 Wu> 1119 usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 Wu> 1120 {
 Wu> ...
 Wu> 1168         dev->net = net;
 Wu> 1169         strcpy (net->name, "usb%d");
 Wu> 1170         memcpy (net->dev_addr, node_id, sizeof node_id);
 Wu> ...

So what happens if you plug in 2 devices without an EEPROM? Do they
get the same MAC address? That seems broken.

 >> Anyway, I would prefer to add a dev_warn mentioning the fact that
 >> we're using a random address (and which one).

 Wu> I'll do that in another patch. Since I'd like to add one more similar
 Wu> warning to dm9601_set_mac_address(). That warning helped me identify
 Wu> this bug.

Ok.

-- 
Bye, Peter Korsgaard