|
@@ -137,7 +137,7 @@ static void wpas_dbus_signal_interface(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(WPAS_DBUS_NEW_PATH,
|
|
@@ -200,7 +200,7 @@ void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s, int success)
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -239,7 +239,7 @@ static void wpas_dbus_signal_bss(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -307,7 +307,7 @@ static void wpas_dbus_signal_blob(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -374,7 +374,7 @@ static void wpas_dbus_signal_network(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
os_snprintf(net_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
@@ -467,7 +467,7 @@ void wpas_dbus_signal_network_request(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
field = wpa_supplicant_ctrl_req_to_string(rtype, default_txt, &txt);
|
|
@@ -511,6 +511,8 @@ void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
|
|
|
|
|
|
char path[WPAS_DBUS_OBJECT_PATH_MAX];
|
|
|
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
os_snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
|
"%s/" WPAS_DBUS_NEW_NETWORKS_PART "/%d",
|
|
|
wpa_s->dbus_new_path, ssid->id);
|
|
@@ -539,7 +541,7 @@ void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s)
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -579,7 +581,7 @@ void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -620,7 +622,7 @@ void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -686,7 +688,7 @@ void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -760,7 +762,7 @@ void wpas_dbus_signal_certification(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -801,7 +803,7 @@ void wpas_dbus_signal_eap_status(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -844,7 +846,7 @@ static void wpas_dbus_signal_sta(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
@@ -916,7 +918,8 @@ void wpas_dbus_signal_p2p_group_removed(struct wpa_supplicant *wpa_s,
|
|
|
if (parent->p2p_mgmt)
|
|
|
parent = parent->parent;
|
|
|
|
|
|
- if (!wpa_s->dbus_groupobj_path)
|
|
|
+ if (!wpa_s->dbus_groupobj_path || !wpa_s->dbus_new_path ||
|
|
|
+ !parent->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
msg = dbus_message_new_signal(parent->dbus_new_path,
|
|
@@ -984,6 +987,8 @@ void wpas_dbus_signal_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
|
|
|
|
|
|
if (wpa_s->p2p_mgmt)
|
|
|
wpa_s = wpa_s->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
|
|
|
if (request || !status) {
|
|
|
if (config_methods & WPS_CONFIG_DISPLAY)
|
|
@@ -1073,6 +1078,8 @@ void wpas_dbus_signal_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
|
|
|
|
|
|
if (wpa_s->p2p_mgmt)
|
|
|
wpa_s = wpa_s->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
|
|
|
os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
|
"%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR,
|
|
@@ -1105,7 +1112,8 @@ static int wpas_dbus_get_group_obj_path(struct wpa_supplicant *wpa_s,
|
|
|
{
|
|
|
char group_name[3];
|
|
|
|
|
|
- if (os_memcmp(ssid->ssid, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN))
|
|
|
+ if (!wpa_s->dbus_new_path ||
|
|
|
+ os_memcmp(ssid->ssid, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN))
|
|
|
return -1;
|
|
|
|
|
|
os_memcpy(group_name, ssid->ssid + P2P_WILDCARD_SSID_LEN, 2);
|
|
@@ -1209,7 +1217,7 @@ void wpas_dbus_signal_p2p_group_started(struct wpa_supplicant *wpa_s,
|
|
|
iface = parent->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !parent->dbus_new_path || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
if (wpa_s->dbus_groupobj_path == NULL)
|
|
@@ -1272,7 +1280,7 @@ void wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s,
|
|
|
|
|
|
os_memset(freqs, 0, sizeof(freqs));
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
@@ -1386,6 +1394,8 @@ void wpas_dbus_signal_p2p_invitation_result(struct wpa_supplicant *wpa_s,
|
|
|
|
|
|
if (wpa_s->p2p_mgmt)
|
|
|
wpa_s = wpa_s->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
|
WPAS_DBUS_NEW_IFACE_P2PDEVICE,
|
|
@@ -1439,6 +1449,8 @@ void wpas_dbus_signal_p2p_peer_joined(struct wpa_supplicant *wpa_s,
|
|
|
parent = wpa_s->parent;
|
|
|
if (parent->p2p_mgmt)
|
|
|
parent = parent->parent;
|
|
|
+ if (!parent->dbus_new_path)
|
|
|
+ return;
|
|
|
|
|
|
os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
|
"%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/"
|
|
@@ -1494,6 +1506,8 @@ void wpas_dbus_signal_p2p_peer_disconnected(struct wpa_supplicant *wpa_s,
|
|
|
parent = wpa_s->parent;
|
|
|
if (parent->p2p_mgmt)
|
|
|
parent = parent->parent;
|
|
|
+ if (!parent->dbus_new_path)
|
|
|
+ return;
|
|
|
|
|
|
os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
|
"%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/"
|
|
@@ -1551,6 +1565,8 @@ void wpas_dbus_signal_p2p_sd_request(struct wpa_supplicant *wpa_s,
|
|
|
|
|
|
if (wpa_s->p2p_mgmt)
|
|
|
wpa_s = wpa_s->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
|
|
|
/* Check if this is a known peer */
|
|
|
if (!p2p_peer_known(wpa_s->global->p2p, sa))
|
|
@@ -1617,6 +1633,8 @@ void wpas_dbus_signal_p2p_sd_response(struct wpa_supplicant *wpa_s,
|
|
|
|
|
|
if (wpa_s->p2p_mgmt)
|
|
|
wpa_s = wpa_s->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
|
|
|
/* Check if this is a known peer */
|
|
|
if (!p2p_peer_known(wpa_s->global->p2p, sa))
|
|
@@ -1678,6 +1696,8 @@ static void wpas_dbus_signal_persistent_group(struct wpa_supplicant *wpa_s,
|
|
|
|
|
|
if (wpa_s->p2p_mgmt)
|
|
|
wpa_s = wpa_s->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
|
|
|
os_snprintf(pgrp_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
|
"%s/" WPAS_DBUS_NEW_PERSISTENT_GROUPS_PART "/%u",
|
|
@@ -1762,6 +1782,8 @@ void wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
|
|
|
if (wpa_s->p2p_mgmt)
|
|
|
wpa_s = wpa_s->parent;
|
|
|
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
|
|
WPAS_DBUS_NEW_IFACE_P2PDEVICE,
|
|
|
"WpsFailed");
|
|
@@ -1862,6 +1884,9 @@ void wpas_dbus_bss_signal_prop_changed(struct wpa_supplicant *wpa_s,
|
|
|
char path[WPAS_DBUS_OBJECT_PATH_MAX];
|
|
|
char *prop;
|
|
|
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
+
|
|
|
switch (property) {
|
|
|
case WPAS_DBUS_BSS_PROP_SIGNAL:
|
|
|
prop = "Signal";
|
|
@@ -2177,7 +2202,7 @@ int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
|
|
|
#endif /* CONFIG_P2P */
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (wpa_s == NULL || wpa_s->global == NULL)
|
|
|
+ if (wpa_s == NULL || wpa_s->global == NULL || !wpa_s->dbus_new_path)
|
|
|
return 0;
|
|
|
ctrl_iface = wpa_s->global->dbus;
|
|
|
if (ctrl_iface == NULL)
|
|
@@ -2351,7 +2376,7 @@ int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
|
|
|
char bss_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (wpa_s == NULL || wpa_s->global == NULL)
|
|
|
+ if (wpa_s == NULL || wpa_s->global == NULL || !wpa_s->dbus_new_path)
|
|
|
return 0;
|
|
|
ctrl_iface = wpa_s->global->dbus;
|
|
|
if (ctrl_iface == NULL)
|
|
@@ -2394,7 +2419,7 @@ int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
|
|
|
struct bss_handler_args *arg;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (wpa_s == NULL || wpa_s->global == NULL)
|
|
|
+ if (wpa_s == NULL || wpa_s->global == NULL || !wpa_s->dbus_new_path)
|
|
|
return 0;
|
|
|
ctrl_iface = wpa_s->global->dbus;
|
|
|
if (ctrl_iface == NULL)
|
|
@@ -3345,7 +3370,7 @@ static void wpas_dbus_signal_peer(struct wpa_supplicant *wpa_s,
|
|
|
iface = wpa_s->global->dbus;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (iface == NULL)
|
|
|
+ if (iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return;
|
|
|
|
|
|
os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
@@ -3422,8 +3447,9 @@ int wpas_dbus_register_peer(struct wpa_supplicant *wpa_s, const u8 *dev_addr)
|
|
|
if (ctrl_iface == NULL)
|
|
|
return 0;
|
|
|
|
|
|
- if (wpa_s->p2p_mgmt)
|
|
|
- wpa_s = wpa_s->parent;
|
|
|
+ wpa_s = wpa_s->parent->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return 0;
|
|
|
|
|
|
os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
|
"%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR,
|
|
@@ -3481,12 +3507,12 @@ int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
|
|
|
int ret;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (wpa_s == NULL || wpa_s->global == NULL ||
|
|
|
- wpa_s->dbus_new_path == NULL)
|
|
|
+ if (wpa_s == NULL || wpa_s->global == NULL)
|
|
|
return 0;
|
|
|
|
|
|
- if (wpa_s->p2p_mgmt)
|
|
|
- wpa_s = wpa_s->parent;
|
|
|
+ wpa_s = wpa_s->parent->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return 0;
|
|
|
|
|
|
ctrl_iface = wpa_s->global->dbus;
|
|
|
if (ctrl_iface == NULL)
|
|
@@ -3512,6 +3538,8 @@ void wpas_dbus_signal_peer_groups_changed(struct wpa_supplicant *wpa_s,
|
|
|
if (wpa_s->p2p_mgmt)
|
|
|
wpa_s = wpa_s->parent;
|
|
|
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return;
|
|
|
os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
|
|
"%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR,
|
|
|
wpa_s->dbus_new_path, MAC2STR(dev_addr));
|
|
@@ -3713,6 +3741,9 @@ int wpas_dbus_register_persistent_group(struct wpa_supplicant *wpa_s,
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
if (wpa_s == NULL || wpa_s->global == NULL)
|
|
|
return 0;
|
|
|
+ wpa_s = wpa_s->parent->parent;
|
|
|
+ if (!wpa_s->dbus_new_path)
|
|
|
+ return 0;
|
|
|
|
|
|
/* Make sure ssid is a persistent group */
|
|
|
if (ssid->disabled != 2 && !ssid->p2p_persistent_group)
|
|
@@ -3797,15 +3828,13 @@ int wpas_dbus_unregister_persistent_group(struct wpa_supplicant *wpa_s,
|
|
|
int ret;
|
|
|
|
|
|
/* Do nothing if the control interface is not turned on */
|
|
|
- if (wpa_s == NULL || wpa_s->global == NULL ||
|
|
|
- wpa_s->dbus_new_path == NULL)
|
|
|
+ if (wpa_s == NULL || wpa_s->global == NULL)
|
|
|
return 0;
|
|
|
|
|
|
- if (wpa_s->p2p_mgmt)
|
|
|
- wpa_s = wpa_s->parent;
|
|
|
+ wpa_s = wpa_s->parent->parent;
|
|
|
|
|
|
ctrl_iface = wpa_s->global->dbus;
|
|
|
- if (ctrl_iface == NULL)
|
|
|
+ if (ctrl_iface == NULL || !wpa_s->dbus_new_path)
|
|
|
return 0;
|
|
|
|
|
|
os_snprintf(pgrp_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|