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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Mar 2010 08:59:09 +0100
From:	Jiri Pirko <jpirko@...hat.com>
To:	Stephen Hemminger <shemminger@...ux-foundation.org>
Cc:	netdev@...r.kernel.org, kaber@...sh.net, fubar@...ibm.com,
	bonding-devel@...ts.sourceforge.net, davem@...emloft.net
Subject: Re: [Bonding-devel] [net-next-2.6 PATCH 2/3] bonding: check return
 value of nofitier when changing type

Wed, Mar 10, 2010 at 11:47:10PM CET, shemminger@...ux-foundation.org wrote:
>On Wed, 10 Mar 2010 21:29:35 +0100
>Jiri Pirko <jpirko@...hat.com> wrote:
>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index bcc490c..5de4a15 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -1084,9 +1084,9 @@ void netdev_state_change(struct net_device *dev)
>>  }
>>  EXPORT_SYMBOL(netdev_state_change);
>>  
>> -void netdev_bonding_change(struct net_device *dev, unsigned long event)
>> +int netdev_bonding_change(struct net_device *dev, unsigned long event)
>>  {
>> -	call_netdevice_notifiers(event, dev);
>> +	return call_netdevice_notifiers(event, dev);
>>  }
>>  EXPORT_SYMBOL(netdev_bonding_change);
>>  
>
>I don't think all this pre-post stuff needed.
>Since this is general (not just bonding) how about

Well actually I reused NETDEV_BONDING_OLDTYPE. This and NETDEV_BONDING_NEWTYPE
is used in inetdev_event() and addrconf_notify(). These functions apparently
need to be notified before and after the change.

>
>int netdev_change_type(struct net_device *dev, int newtype)
>{
>	int ret, oldtype;
>
>	if (dev->flags & IFF_UP)
>		return -EBUSY;
>
>	oldtype = dev->type;
>	dev->type = newtype;
>	ret = call_netdevice_notifier(NETDEV_CHANGETYPE, dev);
>	ret = notifier_to_errno(ret);
>	if (ret)
>	     dev->type = oldtype;
>
>	return ret;
>}

I see you point here, but that would be another notifier event. Do you suggest
to have 3 of them finally? NETDEV_BONDING_OLDTYPE, NETDEV_BONDING_NEWTYPE and
NETDEV_CHANGETYPE. Looks a bit redundant to me...

Thanks.

Jirka

--
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