Fix D-Bus build without CONFIG_P2P=y

This commit is contained in:
Jouni Malinen 2011-06-27 21:23:22 +03:00 committed by Jouni Malinen
parent 20a0b03deb
commit 7a2b53b4ef
2 changed files with 8 additions and 0 deletions

View file

@ -1794,6 +1794,7 @@ int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
struct network_handler_args *arg;
char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
#ifdef CONFIG_P2P
/*
* If it is a persistent group register it as such.
* This is to handle cases where an interface is being initialized
@ -1801,6 +1802,7 @@ int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
*/
if (network_is_persistent_group(ssid))
return wpas_dbus_register_persistent_group(wpa_s, ssid);
#endif /* CONFIG_P2P */
/* Do nothing if the control interface is not turned on */
if (wpa_s == NULL || wpa_s->global == NULL)
@ -1868,9 +1870,11 @@ int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid)
ssid = wpa_config_get_network(wpa_s->conf, nid);
#ifdef CONFIG_P2P
/* If it is a persistent group unregister it as such */
if (ssid && network_is_persistent_group(ssid))
return wpas_dbus_unregister_persistent_group(wpa_s, nid);
#endif /* CONFIG_P2P */
/* Do nothing if the control interface is not turned on */
if (wpa_s == NULL || wpa_s->global == NULL ||

View file

@ -220,14 +220,18 @@ void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
void wpas_notify_persistent_group_added(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
{
#ifdef CONFIG_P2P
wpas_dbus_register_persistent_group(wpa_s, ssid);
#endif /* CONFIG_P2P */
}
void wpas_notify_persistent_group_removed(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
{
#ifdef CONFIG_P2P
wpas_dbus_unregister_persistent_group(wpa_s, ssid->id);
#endif /* CONFIG_P2P */
}