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: 5f92659d88
("mesh: Add mesh peering manager")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
10cf866bac
commit
984d5b7e1f
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue