diff --git a/src/wifi/wifid-link.c b/src/wifi/wifid-link.c index af92198..1e14811 100644 --- a/src/wifi/wifid-link.c +++ b/src/wifi/wifid-link.c @@ -202,16 +202,6 @@ void link_supplicant_p2p_state_known(struct link *l, int state) link_dbus_properties_changed(l, "P2PState", NULL); } -void link_supplicant_managed(struct link *l) -{ - if(l->managed) { - return; - } - - l->managed = true; - link_dbus_properties_changed(l, "Managed", NULL); -} - int link_renamed(struct link *l, const char *ifname) { char *t; @@ -352,6 +342,11 @@ const char *link_get_mac_addr(struct link *l) void link_supplicant_started(struct link *l) { + if(l && !l->managed) { + l->managed = true; + link_dbus_properties_changed(l, "Managed", NULL); + } + if (!l || l->public) return; @@ -361,12 +356,14 @@ void link_supplicant_started(struct link *l) void link_supplicant_stopped(struct link *l) { + if(l && l->managed) { + l->managed = false; + link_dbus_properties_changed(l, "Managed", NULL); + } + if (!l || !l->public) return; - l->managed = false; - link_dbus_properties_changed(l, "Managed", NULL); - log_info("link %s unmanaged", l->ifname); } diff --git a/src/wifi/wifid-supplicant.c b/src/wifi/wifid-supplicant.c index 85c76ea..46b6a48 100644 --- a/src/wifi/wifid-supplicant.c +++ b/src/wifi/wifid-supplicant.c @@ -2581,7 +2581,6 @@ static int supplicant_timer_fn(sd_event_source *source, } else { /* wpas is running smoothly, disable timer */ sd_event_source_set_enabled(source, SD_EVENT_OFF); - link_supplicant_managed(s->l); } } else { /* Who armed this timer? What timer is this? */ diff --git a/src/wifi/wifid.h b/src/wifi/wifid.h index e22e363..caa6354 100644 --- a/src/wifi/wifid.h +++ b/src/wifi/wifid.h @@ -174,7 +174,6 @@ bool link_get_p2p_scanning(struct link *l); int link_get_p2p_state(struct link *l); const char *link_get_mac_addr(struct link *l); -void link_supplicant_managed(struct link *l); void link_supplicant_started(struct link *l); void link_supplicant_stopped(struct link *l); void link_supplicant_p2p_scan_changed(struct link *l, bool new_value);