diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2014-06-18 05:55:47 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-06-18 13:01:32 +0200 |
commit | 5d655d1d3f6880b53ea5bafda159c02da038548f (patch) | |
tree | 290c189dd77e3c12bde58a278ccbc38444df474c /proto-shell.c | |
parent | 5e837916aa1ea128fa833f0803436c24f50cb5df (diff) |
netifd: Check device_claim return code in all cases
Fixes observed issue a tunnel interface is reported as up although device_claim failed
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'proto-shell.c')
-rw-r--r-- | proto-shell.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/proto-shell.c b/proto-shell.c index c4039ed..9fad3a0 100644 --- a/proto-shell.c +++ b/proto-shell.c @@ -463,7 +463,9 @@ proto_shell_update_link(struct proto_shell_state *state, struct blob_attr *data, return UBUS_STATUS_INVALID_ARGUMENT; interface_set_l3_dev(iface, dev); - device_claim(&iface->l3_dev); + if (device_claim(&iface->l3_dev) < 0) + return UBUS_STATUS_UNKNOWN_ERROR; + device_set_present(dev, true); interface_update_start(iface); |