]> git.baikalelectronics.ru Git - kernel.git/commit
rtnetlink: propagate error from dev_change_flags in do_setlink()
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 17 Nov 2008 07:20:31 +0000 (23:20 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Nov 2008 07:20:31 +0000 (23:20 -0800)
commit67052b357816e81971a2b4c95f4baebedf5e2d86
tree53e42bd9bb7db0858af5c1de4dd47e0af3ad3c47
parentc38a2321f8a8c7547f89d4b33b3d3a48a37f532d
rtnetlink: propagate error from dev_change_flags in do_setlink()

Unlike ifconfig, iproute doesn't report an error when setting
an interface up fails:

(example: put wireless network mac80211 interface into repeater mode
with iwconfig but do not set a peer MAC address, it should fail with
-ENOLINK)

without patch:
# ip link set wlan0 up ; echo $?
0
#

with patch:
# ip link set wlan0 up ; echo $?
RTNETLINK answers: Link has been severed
2
#

Propagate the return value from dev_change_flags() to fix this.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Tested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c