net: dev_close() should check IFF_UP
commit8970cb9186550711878378d7091f64b177d350d9
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 10 May 2011 19:26:06 +0000 (10 12:26 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 21 May 2011 22:13:17 +0000 (21 15:13 -0700)
tree41fef08b3e3deca52c36e4c142df7dc5120fee70
parentfc4e1025211914e13b9c5a8268d52fb2b9d90032
net: dev_close() should check IFF_UP

commit e14a599335427f81bbb0008963e59aa9c6449dce upstream.

Commit 443457242beb (factorize sync-rcu call in
unregister_netdevice_many) mistakenly removed one test from dev_close()

Following actions trigger a BUG :

modprobe bonding
modprobe dummy
ifconfig bond0 up
ifenslave bond0 dummy0
rmmod dummy

dev_close() must not close a non IFF_UP device.

With help from Frank Blaschka and Einar EL Lueck

Reported-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Reported-by: Einar EL Lueck <ELELUECK@de.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/core/dev.c