]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
D-Bus: Skip property update actions when wpa_config_set() returns 1
authorMatthew Wang <matthewmwang@chromium.org>
Thu, 16 Jul 2020 00:17:40 +0000 (17:17 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 9 Oct 2020 12:31:05 +0000 (15:31 +0300)
When network properties are updated via dbus, wpa_config_set() is used
to update the property in the wpa_ssid struct. If it returns 1, the
property was not changed and there's no need to perform any of the
update actions.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
wpa_supplicant/dbus/dbus_new_handlers.c

index 2cfc87fa80280e1c4d1f76bb0314dfef42b624d6..1c3f333678ed5f1143212b18259f93de38ba92d8 100644 (file)
@@ -268,8 +268,11 @@ dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s,
                } else
                        goto error;
 
-               if (wpa_config_set(ssid, entry.key, value, 0) < 0)
+               ret = wpa_config_set(ssid, entry.key, value, 0);
+               if (ret < 0)
                        goto error;
+               if (ret == 1)
+                       goto skip_update;
 
                if (os_strcmp(entry.key, "bssid") != 0 &&
                    os_strcmp(entry.key, "priority") != 0)
@@ -291,6 +294,7 @@ dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s,
                else if (os_strcmp(entry.key, "priority") == 0)
                        wpa_config_update_prio_list(wpa_s->conf);
 
+       skip_update:
                os_free(value);
                value = NULL;
                wpa_dbus_dict_entry_clear(&entry);