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>
switch (ev) {
case IFPEV_UP:
if (iface->state != IFS_SETUP) {
switch (ev) {
case IFPEV_UP:
if (iface->state != IFS_SETUP) {
- interface_event(iface, IFEV_UPDATE);
+ if (iface->state == IFS_UP && iface->updated)
+ interface_event(iface, IFEV_UPDATE);
-interface_update_start(struct interface *iface)
+interface_update_start(struct interface *iface, const bool keep_old)
- interface_ip_update_start(&iface->proto_ip);
+
+ if (!keep_old)
+ interface_ip_update_start(&iface->proto_ip);
int interface_add_data(struct interface *iface, const struct blob_attr *data);
int interface_parse_data(struct interface *iface, const struct blob_attr *attr);
int interface_add_data(struct interface *iface, const struct blob_attr *data);
int interface_parse_data(struct interface *iface, const struct blob_attr *attr);
-void interface_update_start(struct interface *iface);
+void interface_update_start(struct interface *iface, const bool keep_old);
void interface_update_complete(struct interface *iface);
void interface_start_pending(void);
void interface_update_complete(struct interface *iface);
void interface_start_pending(void);
return UBUS_STATUS_UNKNOWN_ERROR;
device_set_present(dev, true);
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)
proto_apply_ip_settings(iface, data, addr_ext);
if ((cur = tb[NOTIFY_ROUTES]) != NULL)
interface_update_complete(state->proto.iface);
if ((state->sm != S_SETUP_ABORT) && (state->sm != S_TEARDOWN)) {
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);