projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f3074dd
)
proto-shell: reset l3 device if it was set before
author
Felix Fietkau
<nbd@openwrt.org>
Tue, 18 Oct 2011 18:38:44 +0000
(20:38 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Tue, 18 Oct 2011 18:38:44 +0000
(20:38 +0200)
proto-shell.c
patch
|
blob
|
history
diff --git
a/proto-shell.c
b/proto-shell.c
index
f197c62
..
415eb74
100644
(file)
--- a/
proto-shell.c
+++ b/
proto-shell.c
@@
-318,11
+318,14
@@
proto_shell_update_link(struct proto_shell_state *state, struct blob_attr **tb)
if (!tb[NOTIFY_IFNAME]) {
if (!state->proto.iface->main_dev.dev)
return UBUS_STATUS_INVALID_ARGUMENT;
if (!tb[NOTIFY_IFNAME]) {
if (!state->proto.iface->main_dev.dev)
return UBUS_STATUS_INVALID_ARGUMENT;
- } else if (!state->l3_dev.dev) {
+ } else {
+ if (state->l3_dev.dev)
+ device_remove_user(&state->l3_dev);
+
device_add_user(&state->l3_dev,
device_get(blobmsg_data(tb[NOTIFY_IFNAME]), true));
device_add_user(&state->l3_dev,
device_get(blobmsg_data(tb[NOTIFY_IFNAME]), true));
- device_claim(&state->l3_dev);
state->proto.iface->l3_dev = &state->l3_dev;
state->proto.iface->l3_dev = &state->l3_dev;
+ device_claim(&state->l3_dev);
}
interface_ip_update_start(state->proto.iface);
}
interface_ip_update_start(state->proto.iface);