From 5b5a9b60fb7dff867b9579b598fac6530f153a83 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 28 May 2025 13:10:22 -0700 Subject: [PATCH] station: fix DBus reply for Connect() with netconfig When netconfig is enabled the DBus reply was being sent in station_connect_ok(), before netconfig had even started. This would result in a call to Connect() succeeding from a DBus perspective but really netconfig still needed to complete before IWD transitioned to a connected state. Fixes: 72e7d3ceb83d ("station: Handle NETCONFIG_EVENT_FAILED") --- src/station.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/station.c b/src/station.c index 2b6a18f8..4180b7a4 100644 --- a/src/station.c +++ b/src/station.c @@ -1795,6 +1795,13 @@ static void station_enter_state(struct station *station, periodic_scan_stop(station); break; case STATION_STATE_CONNECTED: + if (station->connect_pending) { + struct l_dbus_message *reply = + l_dbus_message_new_method_return( + station->connect_pending); + dbus_pending_reply(&station->connect_pending, reply); + } + l_dbus_object_add_interface(dbus, netdev_get_path(station->netdev), IWD_STATION_DIAGNOSTIC_INTERFACE, @@ -3581,13 +3588,6 @@ static void station_connect_ok(struct station *station) l_debug(""); - if (station->connect_pending) { - struct l_dbus_message *reply = - l_dbus_message_new_method_return( - station->connect_pending); - dbus_pending_reply(&station->connect_pending, reply); - } - /* * Get a neighbor report now so future roams can avoid waiting for * a report at that time