X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=interface.c;h=b9833d30b5cfaa1f34c4ab3c081e84ad2b88dccf;hb=c007f08413edc15805c248a8d65f075bb5fb0bdd;hp=7b18cef58a47d8aed15c0e568652a54b1d8d2ae7;hpb=b998775b925330725e547af8d33394db0d638f7a;p=project%2Fnetifd.git 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; } }