aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mesh_mpm.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-04-15 19:24:49 (GMT)
committerJouni Malinen <j@w1.fi>2019-04-15 19:26:07 (GMT)
commit984d5b7e1fdd6c23337445ed08b2bd0b65504084 (patch)
treed72574ce625e513b4d27fbba903248085cb968f1 /wpa_supplicant/mesh_mpm.c
parent10cf866bac4b8e7cc41ca6af37938f6591e0b647 (diff)
downloadhostap-984d5b7e1fdd6c23337445ed08b2bd0b65504084.zip
hostap-984d5b7e1fdd6c23337445ed08b2bd0b65504084.tar.gz
hostap-984d5b7e1fdd6c23337445ed08b2bd0b65504084.tar.bz2
mesh: Fix random llid generation in an error case
If os_get_random() fails, llid must not be read/used since it could be uninitialized. Handle that special case by clearing llid explicitly to 0 to continue iteration. Fixes: 5f92659d88f1 ("mesh: Add mesh peering manager") Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'wpa_supplicant/mesh_mpm.c')
-rw-r--r--wpa_supplicant/mesh_mpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index 4485939..9d6ab8d 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -189,7 +189,7 @@ static void mesh_mpm_init_link(struct wpa_supplicant *wpa_s,
do {
if (os_get_random((u8 *) &llid, sizeof(llid)) < 0)
- continue;
+ llid = 0; /* continue */
} while (!llid || llid_in_use(wpa_s, llid));
sta->my_lid = llid;