Subject: Re: [PATCH net v4] rtnl/bond: don't send rtnl msg for unregistered iface

From: Nicolas Dichtel <[email-masked]>
Date: Wed, 13 May 2015 14:36:32 +0200

Le 13/05/2015 14:24, Jiri Pirko a écrit :
> Wed, May 13, 2015 at 02:19:42PM CEST, [email-masked] wrote:
[snip]
>> The patch fixes the spotted bug by checking in bond driver if the interface
>> is registered before calling the notifier chain.
>> It also adds a check in rtmsg_ifinfo() to prevent this kind of bug in the
>> future.
[snip]
>> --- a/net/core/rtnetlink.c
>> +++ b/net/core/rtnetlink.c
>> @@ -2415,6 +2415,9 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned int change,
>> {
>> 	struct sk_buff *skb;
>>
>> +	if (dev->reg_state != NETREG_REGISTERED)
>> +		return;
>> +
>
> This is redundant now that you check it in __bond_opt_set.
As said in the commit log ;-)

>
> Sorry to be a pain Nicolas :/
>
Yeah, I see that you don't want this check ;-)
In fact, I don't really understand why because it does not harm and it prevents
to have again the same bug.

Does anyone else have an opinion on that?