summaryrefslogtreecommitdiffhomepage
path: root/proto-shell.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-11-02 09:22:10 +0100
committerFelix Fietkau <nbd@nbd.name>2016-11-04 13:24:02 +0100
commitb8ef742bd04ebef324ae11aee56c6e1d2cb7e0ad (patch)
treea7a50335577fef91f6e4fe23a926d89769f11a69 /proto-shell.c
parentbf4cfc851d422c742e7c38bd552b792194655a7e (diff)
interface: Fix triggering of interface update event
In case the keep flag is set in proto_shell_update_link no interface update event is triggered when IPv4/6 addresses/routes/... are updated as the proto_event callback is not called due to keep being set. Unconditionally call the proto_event callback handler in proto_shell_update_link but let the proto_event callback handler; in this case interface_proto_event_cb, decide which actions need to be taken dependant on the interface state. In case the interface is already in the up state trigger an update event only if the interface updated flag actually indicates either an IP address/ route/data change; before interface update events were actually sent wihtout any parameter change. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'proto-shell.c')
-rw-r--r--proto-shell.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/proto-shell.c b/proto-shell.c
index 998a44c..ef56aa8 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -538,10 +538,10 @@ proto_shell_update_link(struct proto_shell_state *state, struct blob_attr *data,
return UBUS_STATUS_UNKNOWN_ERROR;
device_set_present(dev, true);
-
- interface_update_start(iface);
}
+ interface_update_start(iface, keep);
+
proto_apply_ip_settings(iface, data, addr_ext);
if ((cur = tb[NOTIFY_ROUTES]) != NULL)
@@ -562,8 +562,7 @@ proto_shell_update_link(struct proto_shell_state *state, struct blob_attr *data,
interface_update_complete(state->proto.iface);
if ((state->sm != S_SETUP_ABORT) && (state->sm != S_TEARDOWN)) {
- if (!keep)
- state->proto.proto_event(&state->proto, IFPEV_UP);
+ state->proto.proto_event(&state->proto, IFPEV_UP);
state->sm = S_IDLE;
}