public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v3 1/4] knownnetworks: Add UPDATED event
@ 2023-12-19 18:08 James Prestwood
  2023-12-19 18:08 ` [PATCH v3 2/4] dpp: fix extra settings not being used when connecting James Prestwood
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Prestwood @ 2023-12-19 18:08 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

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).
---
 src/knownnetworks.c | 4 ++++
 src/knownnetworks.h | 1 +
 src/network.c       | 2 ++
 3 files changed, 7 insertions(+)

v3:
 * Removed bulk of this change, just emit UPDATED to let DPP know the
   profile was seen by knownnetworks

diff --git a/src/knownnetworks.c b/src/knownnetworks.c
index d4d50a6f..04ce74ec 100644
--- a/src/knownnetworks.c
+++ b/src/knownnetworks.c
@@ -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,
diff --git a/src/knownnetworks.h b/src/knownnetworks.h
index 0a5c9e25..e8ffac0b 100644
--- a/src/knownnetworks.h
+++ b/src/knownnetworks.h
@@ -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 {
diff --git a/src/network.c b/src/network.c
index 3918ae08..4723334e 100644
--- a/src/network.c
+++ b/src/network.c
@@ -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;
 	}
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-20  1:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 18:08 [PATCH v3 1/4] knownnetworks: Add UPDATED event James Prestwood
2023-12-19 18:08 ` [PATCH v3 2/4] dpp: fix extra settings not being used when connecting James Prestwood
2023-12-19 18:08 ` [PATCH v3 3/4] auto-t: add DPP tests to check extra settings are applied James Prestwood
2023-12-19 18:08 ` [PATCH v3 4/4] auto-t: increase RAM when running with valgrind (UML) James Prestwood
2023-12-20  1:49 ` [PATCH v3 1/4] knownnetworks: Add UPDATED event Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox