netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH?] Fix call to ->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags()
@ 2008-05-20 12:11 David Woodhouse
  2008-05-20 12:47 ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: David Woodhouse @ 2008-05-20 12:11 UTC (permalink / raw)
  To: Linux Netdev List; +Cc: Patrick McHardy

Am I just being particularly dim today, or can the call to
dev->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags() never
happen?

We've just set dev->flags = flags & IFF_MULTICAST, effectively. So the
condition '(dev->flags ^ flags) & IFF_MULTICAST' is _never_ going to be
true.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/net/core/dev.c b/net/core/dev.c
index a1607bc..2ea3a14 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3130,14 +3130,14 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
 	dev->flags = (flags & (IFF_DEBUG | IFF_NOTRAILERS | IFF_NOARP |
 			       IFF_DYNAMIC | IFF_MULTICAST | IFF_PORTSEL |
 			       IFF_AUTOMEDIA)) |
 		     (dev->flags & (IFF_UP | IFF_VOLATILE | IFF_PROMISC |
 				    IFF_ALLMULTI));
 
 	/*
 	 *	Load in the correct multicast list now the flags have changed.
 	 */
 
-	if (dev->change_rx_flags && (dev->flags ^ flags) & IFF_MULTICAST)
+	if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST)
 		dev->change_rx_flags(dev, IFF_MULTICAST);
 
 	dev_set_rx_mode(dev);


-- 
dwmw2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH?] Fix call to ->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags()
  2008-05-20 12:11 [PATCH?] Fix call to ->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags() David Woodhouse
@ 2008-05-20 12:47 ` Patrick McHardy
  2008-05-20 21:36   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2008-05-20 12:47 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Netdev List

David Woodhouse wrote:
> Am I just being particularly dim today, or can the call to
> dev->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags() never
> happen?
> 
> We've just set dev->flags = flags & IFF_MULTICAST, effectively. So the
> condition '(dev->flags ^ flags) & IFF_MULTICAST' is _never_ going to be
> true.

Thanks for catching this, you're correct of course.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH?] Fix call to ->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags()
  2008-05-20 12:47 ` Patrick McHardy
@ 2008-05-20 21:36   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2008-05-20 21:36 UTC (permalink / raw)
  To: kaber; +Cc: dwmw2, netdev

From: Patrick McHardy <kaber@trash.net>
Date: Tue, 20 May 2008 14:47:32 +0200

> David Woodhouse wrote:
> > Am I just being particularly dim today, or can the call to
> > dev->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags() never
> > happen?
> > 
> > We've just set dev->flags = flags & IFF_MULTICAST, effectively. So the
> > condition '(dev->flags ^ flags) & IFF_MULTICAST' is _never_ going to be
> > true.
> 
> Thanks for catching this, you're correct of course.

Applied and queued to -stable, thanks everyone!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-20 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20 12:11 [PATCH?] Fix call to ->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags() David Woodhouse
2008-05-20 12:47 ` Patrick McHardy
2008-05-20 21:36   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).