eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 4b2c6de45ccd9cb4bc12ea4ac135a5cb81c45dbe
parent 30cc3ecf7b512c85613df83cab07d6bc87e9d9c6
Author: James Prestwood <prestwoj@gmail.com>
Date:   Tue, 10 Sep 2024 11:47:50 -0700

station: fix crash if affinities watch gets removed

If the affinity watch is removed by setting an empty list the
disconnect callback won't be called which was the only place
the watch ID was cleared. This resulted in the next SetProperty call
to think a watch existed, and attempt to compare the sender address
which would be NULL.

The watch ID should be cleared inside the destroy callback, not
the disconnect callback.

Diffstat:
Msrc/station.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/station.c b/src/station.c @@ -4601,7 +4601,6 @@ static void station_affinity_disconnected_cb(struct l_dbus *dbus, struct station *station = user_data; l_dbus_remove_watch(dbus_get_bus(), station->affinity_watch); - station->affinity_watch = 0; l_debug("client that set affinity has disconnected"); @@ -4614,6 +4613,8 @@ static void station_affinity_watch_destroy(void *user_data) struct station *station = user_data; bool empty = l_queue_length(station->affinities) == 0; + station->affinity_watch = 0; + l_free(station->affinity_client); station->affinity_client = NULL;