diff mbox series

[2/8] station: check for matching SSID in Roam()

Message ID 20220810231621.372514-2-prestwoj@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show
Series [1/8] network: make network const in network_bss_list_get_entries | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Aug. 10, 2022, 11:16 p.m. UTC
This is a debug method, but still should verify the SSID in the
target matches the current BSS.
---
 src/station.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/src/station.c b/src/station.c
index 8c230b52..57dbd0d5 100644
--- a/src/station.c
+++ b/src/station.c
@@ -4373,6 +4373,13 @@  static struct l_dbus_message *station_force_roam(struct l_dbus *dbus,
 	if (!target || target == station->connected_bss)
 		return dbus_error_invalid_args(message);
 
+	if (station->connected_bss->ssid_len != target->ssid_len)
+		goto invalid_args;
+
+	if (memcmp(station->connected_bss->ssid, target->ssid,
+				target->ssid_len))
+		goto invalid_args;
+
 	l_debug("Attempting forced roam to BSS "MAC, MAC_STR(mac));
 
 	/* The various roam routines expect this to be set from scanning */