Skip to content

Commit

Permalink
net: delete duplicate dev_set_rx_mode() call
Browse files Browse the repository at this point in the history
In __dev_open(), it already calls dev_set_rx_mode().
and dev_set_rx_mode() has no effect for a net device which does not have
IFF_UP flag set.

So the call of dev_set_rx_mode() is duplicate in __dev_change_flags().

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Peter Pan(潘卫平) authored and David S. Miller committed Jun 17, 2014
1 parent 3dac9a7 commit d215d10
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -5432,13 +5432,9 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags)
*/

ret = 0;
if ((old_flags ^ flags) & IFF_UP) { /* Bit is different ? */
if ((old_flags ^ flags) & IFF_UP)
ret = ((old_flags & IFF_UP) ? __dev_close : __dev_open)(dev);

if (!ret)
dev_set_rx_mode(dev);
}

if ((flags ^ dev->gflags) & IFF_PROMISC) {
int inc = (flags & IFF_PROMISC) ? 1 : -1;
unsigned int old_flags = dev->flags;
Expand Down

0 comments on commit d215d10

Please sign in to comment.