3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-27 02:32:52 +01:00

network: Reset connected_time when forgetting

If a network is being forgotten, then make sure to reset connected_time.
Otherwise the rank logic thinks that the network is known which can
result in network_find_rank_index returning -1.

Found by sanitizer:
src/network.c:1329:23: runtime error: index -1 out of bounds for type
	'double [64]'
This commit is contained in:
Denis Kenzior 2019-01-11 17:28:10 -06:00
parent e256cbaba9
commit 782bd4a7ae

View File

@ -1389,6 +1389,7 @@ static void disconnect_no_longer_known(struct station *station, void *user_data)
void network_info_forget_known(struct network_info *network)
{
network->is_known = false;
memset(&network->connected_time, 0, sizeof(network->connected_time));
station_foreach(emit_known_network_changed, network);
station_foreach(disconnect_no_longer_known, network);