Skip to contentSkip to conversation

station: tie diagnostic interface cleanup to DISCONNECTING

PATCH Applied James Prestwood 2 participants 3 messages Apr 28, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/2 station: tie diagnostic interface cleanup to DISCONNECTING

Prior to this the diagnostic interface was taken down when station transitioned to DISCONNECTED. This worked but once station is in a DISCONNECTING state it then calls netdev_disconnect(). Trying to get any diagnostic data during this time may not work as its unknown what state exactly the kernel is in. To be safe take the interface down when station is DISCONNECTING.

---
 src/station.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
src/station.c +4 -3
index 9c2b4e64..0cee3525 100644
@@ -1229,9 +1229,6 @@ static void station_enter_state(struct station *station,
 		periodic_scan_stop(station);
 		break;
 	case STATION_STATE_DISCONNECTED:
-		l_dbus_object_remove_interface(dbus_get_bus(),
-					netdev_get_path(station->netdev),
-					IWD_STATION_DIAGNOSTIC_INTERFACE);
 		periodic_scan_stop(station);
 		break;
 	case STATION_STATE_CONNECTED:
@@ -1242,6 +1239,10 @@ static void station_enter_state(struct station *station,
 		periodic_scan_stop(station);
 		break;
 	case STATION_STATE_DISCONNECTING:
+		l_dbus_object_remove_interface(dbus_get_bus(),
+					netdev_get_path(station->netdev),
+					IWD_STATION_DIAGNOSTIC_INTERFACE);
+		break;
 	case STATION_STATE_ROAMING:
 		break;
 	}
Signature · 1 line
2.26.2
#1 lore raw

PATCH v5 2/2 station: remove diagnostic interface on station_free

If station gets removed ungracefully (e.g. rfkill/hotplug) it may not have a chance to disconnect, meaning the diagnostic interface would remain up.

---
 src/station.c | 4 ++++
 1 file changed, 4 insertions(+)

v5:
* called remove_interface directly as this is all we needed with the state transition anyways.

src/station.c +4 -0
index 0cee3525..a3a49fc9 100644
@@ -3487,6 +3487,10 @@ static void station_free(struct station *station)
 	if (station->connected_bss)
 		netdev_disconnect(station->netdev, NULL, NULL);
 
+	l_dbus_object_remove_interface(dbus_get_bus(),
+					netdev_get_path(station->netdev),
+					IWD_STATION_DIAGNOSTIC_INTERFACE);
+
 	if (station->netconfig) {
 		netconfig_destroy(station->netconfig);
 		station->netconfig = NULL;
Signature · 1 line
2.26.2
#2 lore raw

Re: [PATCH v5 2/2] station: remove diagnostic interface on station_free

Hi James,

Quoted 11 lines · James Prestwood

If station gets removed ungracefully (e.g. rfkill/hotplug) it may not have a chance to disconnect, meaning the diagnostic interface would remain up.

---
  src/station.c | 4 ++++
  1 file changed, 4 insertions(+)

v5:
* called remove_interface directly as this is all we needed with the state transition anyways.

Applied, thanks.

Regards,
-Denis