summaryrefslogtreecommitdiffhomepage
path: root/interface.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-29 16:12:17 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-29 16:12:45 +0200
commitc007f08413edc15805c248a8d65f075bb5fb0bdd (patch)
tree9e36aba81b0c1b1e3a7d83f04ed084dd1fdae221 /interface.c
parent5df548d8edd3f9be39d409d1eeeaef99fbb27aa0 (diff)
interface: report link up events for force_link interfaces
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c9
1 files changed, 7 insertions, 2 deletions
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;
}
}