Re: [PATCH] e1000, e1000e valid-addr fixes

2007-11-01 Thread Jeff Garzik
Stephen Hemminger wrote: How about: static int eth_validate_addr(const struct net_device *dev) { return is_valid_ether_addr(dev->dev_addr) ? 0 : -EINVAL; } hmmm -- its a slow path, so I don't see the value of marking the argument 'const' -- right now this implementation merely reads t

Re: [PATCH] e1000, e1000e valid-addr fixes

2007-11-01 Thread Jeff Garzik
Kok, Auke wrote: David Miller wrote: From: Jeff Garzik <[EMAIL PROTECTED]> Date: Tue, 23 Oct 2007 22:20:30 -0400 David Miller wrote: From: Jeff Garzik <[EMAIL PROTECTED]> Date: Tue, 23 Oct 2007 21:03:36 -0400 I'm wondering if there is a way to avoid adding if (!is_valid_ether_addr(

Re: [PATCH] e1000, e1000e valid-addr fixes

2007-11-01 Thread Stephen Hemminger
How about: static int eth_validate_addr(const struct net_device *dev) { return is_valid_ether_addr(dev->dev_addr) ? 0 : -EINVAL; } -- Stephen Hemminger <[EMAIL PROTECTED]> - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] Mo

Re: [PATCH] e1000, e1000e valid-addr fixes

2007-11-01 Thread Kok, Auke
David Miller wrote: > From: Jeff Garzik <[EMAIL PROTECTED]> > Date: Tue, 23 Oct 2007 22:20:30 -0400 > >> David Miller wrote: >>> From: Jeff Garzik <[EMAIL PROTECTED]> >>> Date: Tue, 23 Oct 2007 21:03:36 -0400 >>> I'm wondering if there is a way to avoid adding if (!is_valid_ether

Re: [PATCH] e1000, e1000e valid-addr fixes

2007-10-23 Thread David Miller
From: Jeff Garzik <[EMAIL PROTECTED]> Date: Tue, 23 Oct 2007 22:20:30 -0400 > David Miller wrote: > > From: Jeff Garzik <[EMAIL PROTECTED]> > > Date: Tue, 23 Oct 2007 21:03:36 -0400 > > > >> I'm wondering if there is a way to avoid adding > >> > >>if (!is_valid_ether_addr(dev->dev_addr)) > >>

Re: [PATCH] e1000, e1000e valid-addr fixes

2007-10-23 Thread Jeff Garzik
David Miller wrote: From: Jeff Garzik <[EMAIL PROTECTED]> Date: Tue, 23 Oct 2007 21:03:36 -0400 I'm wondering if there is a way to avoid adding if (!is_valid_ether_addr(dev->dev_addr)) return -EINVAL; to every ethernet driver's ->open() hook. The first idea I get is:

Re: [PATCH] e1000, e1000e valid-addr fixes

2007-10-23 Thread Adrian Bunk
On Tue, Oct 23, 2007 at 08:55:29PM -0400, Jeff Garzik wrote: > Actually, looking over the code I see obvious bugs in the logic: > > An invalid ethernet address should not cause device loading to fail, > because the user is given the opportunity to supply a MAC address via > userspace (ifconfig or

Re: [PATCH] e1000, e1000e valid-addr fixes

2007-10-23 Thread David Miller
From: Jeff Garzik <[EMAIL PROTECTED]> Date: Tue, 23 Oct 2007 21:03:36 -0400 > I'm wondering if there is a way to avoid adding > > if (!is_valid_ether_addr(dev->dev_addr)) > return -EINVAL; > > to every ethernet driver's ->open() hook. The first idea I get is: 1) Create netd

Re: [PATCH] e1000, e1000e valid-addr fixes

2007-10-23 Thread Jeff Garzik
Jeff Garzik wrote: Actually, looking over the code I see obvious bugs in the logic: An invalid ethernet address should not cause device loading to fail, because the user is given the opportunity to supply a MAC address via userspace (ifconfig or whatever) before the interface goes up. I just

[PATCH] e1000, e1000e valid-addr fixes

2007-10-23 Thread Jeff Garzik
Actually, looking over the code I see obvious bugs in the logic: An invalid ethernet address should not cause device loading to fail, because the user is given the opportunity to supply a MAC address via userspace (ifconfig or whatever) before the interface goes up. I just created the attache