knownnetworks: Add UPDATED event

If a known network is modified on disk known networks does not have
any way of notifying other modules. This will be needed to support a
corner case in DPP if a profile exists but is overwritten after DPP
configuration. Add this event to known networks and handle it in
network.c (though nothing needs to be done in that case).
This commit is contained in:
James Prestwood 2023-12-19 10:08:23 -08:00 committed by Denis Kenzior
parent 688d277008
commit 7a76385ec9
3 changed files with 7 additions and 0 deletions

View File

@ -468,6 +468,10 @@ void known_network_update(struct network_info *network,
known_network_set_autoconnect(network, new->is_autoconnectable);
memcpy(&network->config, new, sizeof(struct network_config));
WATCHLIST_NOTIFY(&known_network_watches,
known_networks_watch_func_t,
KNOWN_NETWORKS_EVENT_UPDATED, network);
}
bool known_networks_foreach(known_networks_foreach_func_t function,

View File

@ -35,6 +35,7 @@ struct network_info;
enum known_networks_event {
KNOWN_NETWORKS_EVENT_ADDED,
KNOWN_NETWORKS_EVENT_REMOVED,
KNOWN_NETWORKS_EVENT_UPDATED,
};
struct network_info_ops {

View File

@ -2033,6 +2033,8 @@ static void known_networks_changed(enum known_networks_event event,
case KNOWN_NETWORKS_EVENT_REMOVED:
station_foreach(emit_known_network_removed, (void *) info);
break;
case KNOWN_NETWORKS_EVENT_UPDATED:
break;
}
}