[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOtvUMd0iFYDhFQT6CFvYvvTjGCNYRX2i2vqJaXf3m=+2z=_jw@mail.gmail.com>
Date: Sun, 28 Jun 2015 16:19:28 +0300
From: Gilad Ben-Yossef <gilad@...yossef.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Gilad Ben-Yossef <giladb@...hip.com>,
David Miller <davem@...emloft.net>,
Netdev <netdev@...r.kernel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
Scott Feldman <sfeldma@...il.com>
Subject: Re: [PATCH net] dsa: fix promiscuity leak on slave dev open error
On Fri, Jun 26, 2015 at 6:04 PM, Andrew Lunn <andrew@...n.ch> wrote:
> On Thu, Jun 25, 2015 at 04:50:13PM +0300, giladb@...hip.com wrote:
>> From: Gilad Ben-Yossef <gilad@...yossef.com>
>>
>> DSA master netdev promiscuity counter was not being properly
>> decremented on slave device open error path.
>>
...
> Acked-by: Andrew Lunn <andrew@...n.ch>
Thank you Andrew.
>
> FYI: I grep'ed the whole kernel. This seems to be the only place 0 is
> passed to dev_set_promiscuity(), i.e. the same bug is not present
> anywhere else.
>
It has occurred to me that dev_set_promiscuity() and its brethren
dev_set_allmulti() may not be the best of interfaces:
- On cursory inspection of code using these function their name
implies the value of the relevant counter is set to the value passed
as parameter, not incremented by it.
- No caller I've managed to spot passes anything but -1 or 1
It seems an interface of
int dev_set_promiscuity(struct net_device *dev, bool on);
int dev_set_allmulti(struct net_device *dev, bool on);
would be as functional (for current users), more readable and less
error prone but I am not sure such a tiny problem (if you can call
this a problem) is worth the churn...
Gilad
--
Gilad Ben-Yossef
Chief Coffee Drinker
gilad@...yossef.com
Israel Cell: +972-52-8260388
US Cell: +1-973-8260388
http://benyossef.com
"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
-- Jean-Baptiste Queru
--
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