diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 8da5683c2..2b8f04bec 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -126,6 +126,10 @@ extern "C" { #define WPA_EVENT_FREQ_CONFLICT "CTRL-EVENT-FREQ-CONFLICT " /** Frequency ranges that the driver recommends to avoid */ #define WPA_EVENT_AVOID_FREQ "CTRL-EVENT-AVOID-FREQ " +/** A new network profile was added (followed by network entry id) */ +#define WPA_EVENT_NETWORK_ADDED "CTRL-EVENT-NETWORK-ADDED " +/** A network profile was removed (followed by prior network entry id) */ +#define WPA_EVENT_NETWORK_REMOVED "CTRL-EVENT-NETWORK-REMOVED " /** Result of MSCS setup */ #define WPA_EVENT_MSCS_RESULT "CTRL-EVENT-MSCS-RESULT " /** WPS overlap detected in PBC mode */ diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index e0e7e5433..fe5e072c2 100644 --- a/wpa_supplicant/notify.c +++ b/wpa_supplicant/notify.c @@ -350,8 +350,11 @@ void wpas_notify_network_added(struct wpa_supplicant *wpa_s, * applications since these network objects won't behave like * regular ones. */ - if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s) + if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s) { wpas_dbus_register_network(wpa_s, ssid); + wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_NETWORK_ADDED "%d", + ssid->id); + } } @@ -381,8 +384,11 @@ void wpas_notify_network_removed(struct wpa_supplicant *wpa_s, if (wpa_s->wpa) wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid); if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s && - !wpa_s->p2p_mgmt) + !wpa_s->p2p_mgmt) { wpas_dbus_unregister_network(wpa_s, ssid->id); + wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_NETWORK_REMOVED "%d", + ssid->id); + } if (network_is_persistent_group(ssid)) wpas_notify_persistent_group_removed(wpa_s, ssid);