lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BF18468.5010005@oracle.com>
Date:	Mon, 17 May 2010 11:01:12 -0700
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	Stephen Hemminger <shemminger@...tta.com>
CC:	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
	netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH -next] bridge: fix build for CONFIG_SYSFS disabled

On 05/17/10 10:56, Stephen Hemminger wrote:
> On Mon, 17 May 2010 09:17:56 -0700
> Randy Dunlap <randy.dunlap@...cle.com> wrote:
> 
>> From: Randy Dunlap <randy.dunlap@...cle.com>
>>
>> Fix build when CONFIG_SYSFS is not enabled:
>>
>> net/bridge/br_if.c:136: error: 'struct net_bridge_port' has no member named 'sysfs_name'
>>
>> Signed-off-by: Randy Dunlap <randy.dunlap@...cle.com>
>> ---
>>  net/bridge/br_if.c |    2 ++
>>  1 file changed, 2 insertions(+)
>>
>> --- linux-next-20100517.orig/net/bridge/br_if.c
>> +++ linux-next-20100517/net/bridge/br_if.c
>> @@ -133,7 +133,9 @@ static void del_nbp(struct net_bridge_po
>>  	struct net_bridge *br = p->br;
>>  	struct net_device *dev = p->dev;
>>  
>> +#ifdef CONFIG_SYSFS
>>  	sysfs_remove_link(br->ifobj, p->sysfs_name);
>> +#endif
>>  
>>  	dev_set_promiscuity(dev, -1);
>>  
> 
> I don't like peppering code with #ifdef like this.

Thanks.  I didn't like it either.

> Turns out that in this place sysfs_name is always the same
> as the device name so instead:
> 
> 
> --- a/net/bridge/br_if.c	2010-05-17 10:40:49.808031840 -0700
> +++ b/net/bridge/br_if.c	2010-05-17 10:49:47.767669246 -0700
> @@ -133,7 +133,7 @@ static void del_nbp(struct net_bridge_po
>  	struct net_bridge *br = p->br;
>  	struct net_device *dev = p->dev;
>  
> -	sysfs_remove_link(br->ifobj, p->sysfs_name);
> +	sysfs_remove_link(br->ifobj, p->dev->name);
>  
>  	dev_set_promiscuity(dev, -1);
>  
> 
> 


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ