From c007f08413edc15805c248a8d65f075bb5fb0bdd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 29 Jul 2016 16:12:17 +0200 Subject: interface: report link up events for force_link interfaces Signed-off-by: Felix Fietkau --- interface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'interface.c') diff --git a/interface.c b/interface.c index 7b18cef..b9833d3 100644 --- a/interface.c +++ b/interface.c @@ -260,6 +260,7 @@ mark_interface_down(struct interface *iface) if (state == IFS_DOWN) return; + iface->link_up_event = false; iface->state = IFS_DOWN; if (state == IFS_UP) interface_event(iface, IFEV_DOWN); @@ -355,6 +356,11 @@ interface_set_link_state(struct interface *iface, bool new_state) netifd_log_message(L_NOTICE, "Interface '%s' has link connectivity %s\n", iface->name, new_state ? "" : "loss"); iface->link_state = new_state; interface_check_state(iface); + + if (new_state && iface->force_link && iface->state == IFS_UP && !iface->link_up_event) { + interface_event(iface, IFEV_LINK_UP); + iface->link_up_event = true; + } } static void @@ -550,8 +556,7 @@ interface_alias_cb(struct interface_user *dep, struct interface *iface, enum int case IFEV_FREE: interface_remove_user(dep); break; - case IFEV_RELOAD: - case IFEV_UPDATE: + default: break; } } -- cgit v1.2.1