nl80211: Fix initial add_ifidx() realloc to not forget values

We need to make a copy of the old entries the first time the
if_indices buffer gets allocated.
This commit is contained in:
M. Braun 2010-04-16 00:39:59 +03:00 committed by Jouni Malinen
parent 97cfcf6482
commit 0ab7a701ab

View file

@ -4135,7 +4135,9 @@ static void add_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx)
"interfaces"); "interfaces");
wpa_printf(MSG_ERROR, "Ignoring EAPOL on interface %d", ifidx); wpa_printf(MSG_ERROR, "Ignoring EAPOL on interface %d", ifidx);
return; return;
} } else if (!old)
os_memcpy(drv->if_indices, drv->default_if_indices,
sizeof(drv->default_if_indices));
drv->if_indices[drv->num_if_indices] = ifidx; drv->if_indices[drv->num_if_indices] = ifidx;
drv->num_if_indices++; drv->num_if_indices++;
} }