Patchwork [2/3] UBUNTU: SAUCE: smsc95xx: fix macaddr parameter parsing

login
register
mail settings
Submitter Bryan Wu
Date July 13, 2010, 3:22 a.m.
Message ID <1278991369-17962-3-git-send-email-bryan.wu@canonical.com>
Download mbox | patch
Permalink /patch/58700/
State Accepted
Delegated to: Tim Gardner
Headers show

Comments

Bryan Wu - July 13, 2010, 3:22 a.m.
From: Sebastien Jan <s-jan@ti.com>

Depending on the position of the macaddr parameter in the command
line, it could be badly interpreted and discarded.

Signed-off-by: Sebastien Jan <s-jan@ti.com>
---
 drivers/net/usb/smsc95xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Bryan Wu - July 13, 2010, 3:39 a.m.
Sebjan,

Why call this patch 'UBUNTU: SAUCE'? It is supposed to be upstream. I saw your
patches in netdev mail list. Except that, I am OK for this patch.

Acked-by: Bryan Wu <bryan.wu@canonical.com>

Thanks
-Bryan

On 07/13/2010 11:22 AM, Bryan Wu wrote:
> From: Sebastien Jan <s-jan@ti.com>
> 
> Depending on the position of the macaddr parameter in the command
> line, it could be badly interpreted and discarded.
> 
> Signed-off-by: Sebastien Jan <s-jan@ti.com>
> ---
>  drivers/net/usb/smsc95xx.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
> index 0ba06d9..8a4d92b 100644
> --- a/drivers/net/usb/smsc95xx.c
> +++ b/drivers/net/usb/smsc95xx.c
> @@ -677,7 +677,7 @@ static int smsc95xx_is_macaddr_param(struct usbnet *dev, u8 *dev_mac)
>  		}
>  	}
>  
> -	if (j == MAC_ADDR_LEN && !macaddr[i]) {
> +	if (j == MAC_ADDR_LEN) {
>  		netif_dbg(dev, ifup, dev->net, "Overriding MAC address with: "
>  		"%02x:%02x:%02x:%02x:%02x:%02x\n", mtbl[0], mtbl[1], mtbl[2],
>  						mtbl[3], mtbl[4], mtbl[5]);
Sebastien Jan - July 13, 2010, 7:43 a.m.
On 07/13/2010 05:39 AM, Bryan Wu wrote:
> Sebjan,
> 
> Why call this patch 'UBUNTU: SAUCE'? It is supposed to be upstream. I saw your
> patches in netdev mail list. Except that, I am OK for this patch.

The netdev maintainers do not want to handle MAC address passing at this driver level, so this patch will not go upstream. They propose instead to use already existing network APIs: for example, by doing a MAC address reconfiguration in the initramfs.
For short term pandaboard support, I propose to use this patch. We can remove it when we implement this MAC address change within initramfs.
Bryan Wu - July 15, 2010, 4:04 a.m.
On 07/13/2010 03:43 PM, Sebastien Jan wrote:
> On 07/13/2010 05:39 AM, Bryan Wu wrote:
>> Sebjan,
>>
>> Why call this patch 'UBUNTU: SAUCE'? It is supposed to be upstream. I saw your
>> patches in netdev mail list. Except that, I am OK for this patch.
> 
> The netdev maintainers do not want to handle MAC address passing at this driver level, so this patch will not go upstream. They propose instead to use already existing network APIs: for example, by doing a MAC address reconfiguration in the initramfs.
> For short term pandaboard support, I propose to use this patch. We can remove it when we implement this MAC address change within initramfs.
> 

Fair enough, I intent to keep it in our Ubuntu shortly.

Tim, is that possible to merge this?

Thanks,
Tim Gardner - July 15, 2010, 2:01 p.m.
On 07/14/2010 10:04 PM, Bryan Wu wrote:
> On 07/13/2010 03:43 PM, Sebastien Jan wrote:
>> On 07/13/2010 05:39 AM, Bryan Wu wrote:
>>> Sebjan,
>>>
>>> Why call this patch 'UBUNTU: SAUCE'? It is supposed to be upstream. I saw your
>>> patches in netdev mail list. Except that, I am OK for this patch.
>>
>> The netdev maintainers do not want to handle MAC address passing at this driver level, so this patch will not go upstream. They propose instead to use already existing network APIs: for example, by doing a MAC address reconfiguration in the initramfs.
>> For short term pandaboard support, I propose to use this patch. We can remove it when we implement this MAC address change within initramfs.
>>
>
> Fair enough, I intent to keep it in our Ubuntu shortly.
>
> Tim, is that possible to merge this?
>
> Thanks,

applied

Patch

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 0ba06d9..8a4d92b 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -677,7 +677,7 @@  static int smsc95xx_is_macaddr_param(struct usbnet *dev, u8 *dev_mac)
 		}
 	}
 
-	if (j == MAC_ADDR_LEN && !macaddr[i]) {
+	if (j == MAC_ADDR_LEN) {
 		netif_dbg(dev, ifup, dev->net, "Overriding MAC address with: "
 		"%02x:%02x:%02x:%02x:%02x:%02x\n", mtbl[0], mtbl[1], mtbl[2],
 						mtbl[3], mtbl[4], mtbl[5]);