dbus: Add ConfigFile to AddInterface properties

This provides feature parity with the old-style D-Bus API. Explicit
properties to control global parameters is preferred but until that
happens this allows doing things like setting pkcs11_engine_path and
pkcs11_module_path via D-Bus.
This commit is contained in:
Sam Leffler 2011-03-20 11:52:57 +02:00 committed by Jouni Malinen
parent fe885594ac
commit d4c1ec56f1

View file

@ -567,6 +567,7 @@ DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message,
struct wpa_dbus_dict_entry entry;
char *driver = NULL;
char *ifname = NULL;
char *confname = NULL;
char *bridge_ifname = NULL;
dbus_message_iter_init(message, &iter);
@ -588,6 +589,12 @@ DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message,
wpa_dbus_dict_entry_clear(&entry);
if (ifname == NULL)
goto error;
} else if (!strcmp(entry.key, "ConfigFile") &&
(entry.type == DBUS_TYPE_STRING)) {
confname = os_strdup(entry.str_value);
wpa_dbus_dict_entry_clear(&entry);
if (confname == NULL)
goto error;
} else if (!strcmp(entry.key, "BridgeIfname") &&
(entry.type == DBUS_TYPE_STRING)) {
bridge_ifname = os_strdup(entry.str_value);
@ -618,6 +625,7 @@ DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message,
os_memset(&iface, 0, sizeof(iface));
iface.driver = driver;
iface.ifname = ifname;
iface.confname = confname;
iface.bridge_ifname = bridge_ifname;
/* Otherwise, have wpa_supplicant attach to it. */
if ((wpa_s = wpa_supplicant_add_iface(global, &iface))) {