]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Move writing of mesh_rssi_threshold inside CONFIG_MESH
authorLior David <qca_liord@qca.qualcomm.com>
Wed, 30 Aug 2017 13:38:15 +0000 (16:38 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 12 Sep 2017 14:17:21 +0000 (17:17 +0300)
Previously, the code that writes mesh_rssi_threshold to a network block
always executes, but the code that reads it from network block and the
code that initializes it to a default value in a new network block are
inside #ifdef CONFIG_MESH. As a result when writing a config file it
will write mesh_rssi_threshold (since it has a non-default value) and
later fail to read the network block.

Fix this by moving the write code under #ifdef CONFIG_MESH as well.
Note, network blocks which already have mesh_rssi_threshold because of
the bug will still fail to read after the fix.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
wpa_supplicant/config_file.c

index 692b2005c869c7cbfe22cc7db85ef599c665e670..5ccd003878a62b97dfeca185a8db64585b46c5c0 100644 (file)
@@ -795,7 +795,6 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
 #endif /* IEEE8021X_EAPOL */
        INT(mode);
        INT(no_auto_peer);
-       INT_DEF(mesh_rssi_threshold, DEFAULT_MESH_RSSI_THRESHOLD);
        INT(frequency);
        INT(fixed_freq);
 #ifdef CONFIG_ACS
@@ -845,6 +844,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
        INT_DEF(dot11MeshRetryTimeout, DEFAULT_MESH_RETRY_TIMEOUT);
        INT_DEF(dot11MeshConfirmTimeout, DEFAULT_MESH_CONFIRM_TIMEOUT);
        INT_DEF(dot11MeshHoldingTimeout, DEFAULT_MESH_HOLDING_TIMEOUT);
+       INT_DEF(mesh_rssi_threshold, DEFAULT_MESH_RSSI_THRESHOLD);
 #endif /* CONFIG_MESH */
        INT(wpa_ptk_rekey);
        INT(group_rekey);