From patchwork Wed Dec 6 15:07:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481919 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 881C53EA88 for ; Wed, 6 Dec 2023 15:07:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UpFoQJtl" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-77d6f853ba0so75265985a.0 for ; Wed, 06 Dec 2023 07:07:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875234; x=1702480034; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+xwFQUTrHOLX7y/IAk/sto27WOQCKLdXHLGZNIDFn+M=; b=UpFoQJtl1MLZ2AM5jy+eVbTnxi7/atX61r4Qg9tB6YDXj2oVgL9ScdzOWQkZD2LFwa 89ODQY9aGjddLoU04b+vPxoKNkFxGPnMdtXU6nvAIFKenksIfytD0bj1eT91LMFGPqM4 kafzflac4ejRok5WqfaoE5SQX1i5cKey6bicKkmC3yxFWW4OOtvnSPFJYnoncrJju3YU 4Q3i68FQ//CZljXuTjsvUTTWhILPEzANLRBdmDTd6goRla8DX3TFZYtN7iD6Xmftn8No HybPScbxVjeIU3WGP+Qucpf+AifFR3BenS/AVtfjRy7w+/UsjC2n9dmf1xrugG/2zIsp UvMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875234; x=1702480034; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+xwFQUTrHOLX7y/IAk/sto27WOQCKLdXHLGZNIDFn+M=; b=GmY5ADodBzeY2GwHsQC35yznYXkchCQujRqDzjcwybdjcQbd9LYGUggja5NB94jLhk nBbK4huCg7bfuNWH2peLrom/OMpevwDNgAzp9ORHoh9uO5ShGQE5eEP4vzLhiKASwFzo +Dr+L+gszJw6LcCrJ4TV4c6hRGiEZnFI9aE2iOO/Gyb6NutqIcH1BJw6PrPOrO4BNiO4 JqBcrIDApIxzjorG1bjU3b3mttfTQFPw/Oyf/T7QbV46jw4JHjCfQYqsGVOmaGyill5T ZhFlXasNm1YsILfHpzH5VzCEkNhLyhKqYnAN5NNB1Yy3KFJH3H6x5/twBhq4l85CUg3q wIYA== X-Gm-Message-State: AOJu0YyjVzQY6lgiwrVJzdn+7V50XI2zClAKVNXRFBL7sxRMgee4wn+h +0Auwwru0zO1wNt61StpoMx0N8bHB5c= X-Google-Smtp-Source: AGHT+IEwo4k6J4bKIEe9qx9L/TIGF/qO8dAkSFVeH976a7oxMC6OdlIYnFDILDUexltuXoEIXvoMkA== X-Received: by 2002:a05:620a:4387:b0:77f:be1:7fe7 with SMTP id a7-20020a05620a438700b0077f0be17fe7mr1516676qkp.45.1701875234183; Wed, 06 Dec 2023 07:07:14 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:13 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 1/9] auto-t: add explicit stop() to IWD class Date: Wed, 6 Dec 2023 07:07:00 -0800 Message-Id: <20231206150708.2080336-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If tests end in an unknown state it is sometimes required that IWD be stopped manually in order for future tests to run. Add a stop() method so test tearDown() methods can explicitly stop IWD. --- autotests/util/iwd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 3f200beb..b1a57cab 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -1363,6 +1363,10 @@ class IWD(AsyncOpAbstract): self.psk_agents = [] + def stop(self): + if self.namespace.is_process_running('iwd'): + self._iwd_proc.kill() + def __del__(self): for agent in self.psk_agents: self.unregister_psk_agent(agent) From patchwork Wed Dec 6 15:07:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481920 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D601A30FB9 for ; Wed, 6 Dec 2023 15:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y5rGVepU" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-77d63b733e4so428417185a.2 for ; Wed, 06 Dec 2023 07:07:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875235; x=1702480035; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eVHMO7Otc6oGvuT5BowEFRQ4zTPllN713Scz6cm8/k0=; b=Y5rGVepU5lSXRVXvg/j07Itxw6eTGCJ+x5Fzsz+hS7cLDczxzFQ7lhoHpz9dgq0NP9 cOy461W1S5DYIZvHqJ4wB00aKTCa7s9Hay6BdKt4GSLiPjfm1HGN3Ru24uDJRLbnbFau GojHjdQ2PEDwadZZXO0gKNK59C8KZo/nmiI2yp6AMboL7lQaVIGmMsgUlOROP35GfYPY nmaVZQ6TpFJhdFtRTsqUSNra2iYfJwPO8qcQ+SLyEweP8usam2RC9j0Dd0uwMD2xjL+W ajiLa4jd+Z22gC8+xGa/iwB9G/NEl0wKOTqsjr6vA9CMuuS1ILlzzqjRisKOG+tfvXOT rS5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875235; x=1702480035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eVHMO7Otc6oGvuT5BowEFRQ4zTPllN713Scz6cm8/k0=; b=BOLWy6+dR9W6ddL5qLd13LLyvF85dRWCoY0Idbe5uC2ej5VcCFd6rMh5W4wqqMCZoa 1bJP3x7QNjt8PawpQlvIMgzK+30IePvzILaPGOMWpGk45knPgLYAwOboz4kQlXoOUDdW XKxIiCOU146h83tWvUwuHNeX4mccG2fJu3IKR5gtSeVAGmBltTScg2siFtg2cLvIZdlQ yXC5f4KQJK0EcAnPKg6NMpNpUb/kaRrwWnpENObBVgwOZzpMVGZtiBS7O3K7pzxLgHra j/PMgdzfNZvWpabk5fxgbVTy1ufy1n0xbrmi9J2OsH6ewgpH907AopBMoR1Edy6V5aKN i70g== X-Gm-Message-State: AOJu0YxWfPs2qQksEZ1j5bayiCi7Ez8p5bCTw0e4gddA9SyHbjMQpCCz Uu154ci3cdhpKc+661fQwhMJPN18J3o= X-Google-Smtp-Source: AGHT+IG97jT1BV8Hp7eAX7uHhkXWK7sdusvQFHTK+eobQXbM2Tye7Jg3xkus8a7wAfoCQ1d5Jr5QqA== X-Received: by 2002:a05:620a:8e82:b0:77f:38c:f03 with SMTP id rf2-20020a05620a8e8200b0077f038c0f03mr928629qkn.120.1701875235436; Wed, 06 Dec 2023 07:07:15 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:15 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 2/9] auto-t: add association timeout test Date: Wed, 6 Dec 2023 07:07:01 -0800 Message-Id: <20231206150708.2080336-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This tests ensures IWD disconnects after receiving an association timeout event. This exposes a current bug where IWD does not transition to disconnected after an association timeout when FT-roaming. --- autotests/testPSK-roam/failed_roam_test.py | 56 +++++++++++++++------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/autotests/testPSK-roam/failed_roam_test.py b/autotests/testPSK-roam/failed_roam_test.py index 90f07f6b..d42002d4 100644 --- a/autotests/testPSK-roam/failed_roam_test.py +++ b/autotests/testPSK-roam/failed_roam_test.py @@ -46,11 +46,9 @@ class Test(unittest.TestCase): self.rule2.enabled = True self.rule3.enabled = True - wd = IWD(True) + device = self.wd.list_devices(1)[0] - device = wd.list_devices(1)[0] - - self.connect(wd, device, self.bss_hostapd[0]) + self.connect(self.wd, device, self.bss_hostapd[0]) self.rule0.enabled = True @@ -63,10 +61,25 @@ class Test(unittest.TestCase): # IWD should then try BSS 2, and succeed device.wait_for_event('ft-roam', timeout=60) - self.verify_roam(wd, device, self.bss_hostapd[0], self.bss_hostapd[2]) + self.verify_roam(self.wd, device, self.bss_hostapd[0], self.bss_hostapd[2]) self.bss_hostapd[2].deauthenticate(device.address) + # Tests that an associate even should cause a disconnect + def test_ft_over_air_assoc_timeout(self): + self.rule2.enabled = True + self.rule3.enabled = True + self.assoc_rule.enabled = True + + device = self.wd.list_devices(1)[0] + + self.connect(self.wd, device, self.bss_hostapd[0]) + + device.wait_for_event('ft-roam', timeout=60) + + condition = 'obj.state == DeviceState.disconnected' + self.wd.wait_for_object_condition(device, condition) + # FT-over-Air failure with Invalid PMKID, should reassociate def test_ft_over_air_fallback(self): self.rule_bss0.signal = -8000 @@ -81,18 +94,16 @@ class Test(unittest.TestCase): self.bss_hostapd[2].set_value('ft_psk_generate_local', '0') self.bss_hostapd[2].reload() - wd = IWD(True) + device = self.wd.list_devices(1)[0] - device = wd.list_devices(1)[0] - - self.connect(wd, device, self.bss_hostapd[0]) + self.connect(self.wd, device, self.bss_hostapd[0]) # IWD should connect, then attempt a roam to BSS 1, which should # fail and cause a fallback to reassociation device.wait_for_event('ft-fallback-to-reassoc', timeout=60) device.wait_for_event('reassoc-roam', timeout=60) - self.verify_roam(wd, device, self.bss_hostapd[0], self.bss_hostapd[2]) + self.verify_roam(self.wd, device, self.bss_hostapd[0], self.bss_hostapd[2]) # Trigger another roam self.rule_bss2.signal = -8000 @@ -100,11 +111,11 @@ class Test(unittest.TestCase): device.wait_for_event('ft-roam', timeout=60) # Ensure an FT roam back to a properly configured AP works. - self.verify_roam(wd, device, self.bss_hostapd[2], self.bss_hostapd[1]) + self.verify_roam(self.wd, device, self.bss_hostapd[2], self.bss_hostapd[1]) self.bss_hostapd[1].deauthenticate(device.address) condition = 'obj.state == DeviceState.disconnected' - wd.wait_for_object_condition(device, condition) + self.wd.wait_for_object_condition(device, condition) # FT-over-Air failure with Invalid PMKID. The ranking is such that other # FT candidates are available so it should FT elsewhere rather than @@ -122,11 +133,9 @@ class Test(unittest.TestCase): self.bss_hostapd[2].set_value('ft_psk_generate_local', '0') self.bss_hostapd[2].reload() - wd = IWD(True) + device = self.wd.list_devices(1)[0] - device = wd.list_devices(1)[0] - - self.connect(wd, device, self.bss_hostapd[0]) + self.connect(self.wd, device, self.bss_hostapd[0]) # IWD should connect, then attempt a roam to BSS 1, which should # fail and cause the rank to be re-computed. This should then put @@ -134,12 +143,14 @@ class Test(unittest.TestCase): device.wait_for_event('ft-fallback-to-reassoc', timeout=60) device.wait_for_event('ft-roam', timeout=60) - self.verify_roam(wd, device, self.bss_hostapd[0], self.bss_hostapd[1]) + self.verify_roam(self.wd, device, self.bss_hostapd[0], self.bss_hostapd[1]) self.bss_hostapd[1].deauthenticate(device.address) condition = 'obj.state == DeviceState.disconnected' - wd.wait_for_object_condition(device, condition) + self.wd.wait_for_object_condition(device, condition) + def setUp(self): + self.wd = IWD(True) def tearDown(self): os.system('ip link set "' + self.bss_hostapd[0].ifname + '" down') @@ -154,10 +165,14 @@ class Test(unittest.TestCase): self.rule_bss0.enabled = False self.rule_bss1.enabled = False self.rule_bss2.enabled = False + self.assoc_rule.enabled = False for hapd in self.bss_hostapd: hapd.default() + self.wd.stop() + self.wd = None + @classmethod def setUpClass(cls): hwsim = Hwsim() @@ -178,6 +193,11 @@ class Test(unittest.TestCase): cls.rule0.prefix = 'b0' cls.rule0.drop = True + # Drop Associate frames + cls.assoc_rule = hwsim.rules.create() + cls.assoc_rule.prefix = '20' + cls.assoc_rule.drop = True + # Drop Action frames cls.rule1 = hwsim.rules.create() cls.rule1.bidirectional = True From patchwork Wed Dec 6 15:07:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481921 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D76D43EA88 for ; Wed, 6 Dec 2023 15:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NZM5Lg1I" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-77f320ca2d5so35644885a.1 for ; Wed, 06 Dec 2023 07:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875236; x=1702480036; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rj82y449AvkdKesQQUHyj+VdUVbSc8ccNljz1Eh1eO4=; b=NZM5Lg1Ikx18TcK6N3S0nRbkSSRwa63JiulDZMDx4HAw/MofhuzLc51WqtveprYFow cqGVKCn0Xy49opABTtz3QOl8fCI3hqdqnFnEs4ita1MaISBN8HM/243oIj6iujWlO0Lb NtwXV1N9BCJFx9IsP8l2qEhOTdqix+PvNxBBsWKnshHHlx8/prRqH2bKHsX40MZD4GgA JMIniKYcfk563IFbdNkn1JkBIPnTepHGCNHQLnhZOzFlCsJyf2TegFg7SXdtoZndHvsz 9CfRZAFlwxGOXVxXqwzOxb/E53BI7FjDEe+oCYeqaTwhvtb/Iz3yaXXoebNJZFLGJV5c ytDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875236; x=1702480036; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rj82y449AvkdKesQQUHyj+VdUVbSc8ccNljz1Eh1eO4=; b=iVCruRnQkgN2Tjtq4WaZgwlGjI1HHXhuQqAyg+hchgutN4HMu1/uhZWCaI6/Ypy+/3 UGJUpq3BNl+2A6sWd/uNei/fupW4zDnX8ihMJ4c9bGpo9l1AUBeEpN3YAa24g381qsXp HYz/TdA/AwmyxnQrLJjHhZeZ6p5DoVaqAxyw38wb2IfQZMghTl5oXJF8lEKpmw0qCiwv sYS5kLbUnQeKSRPzDg0kbCGsS+Gk8IpxuftxLjesTEY+iYy/SFhuiRla5/oNtGvfGq1u Xx88gG8jeb179TZnaDCUkV2vqLd0upVM1CxrNoajB9tDPtqBtyfYuIdYf+YUojCcZcFm M+0A== X-Gm-Message-State: AOJu0Yx4Ee0DDMtgWbtQmYid4SfXgQjD/fASeFGxNcnAo13TVJ/vXGvi NR2Ux03deWrtmC+P6Xfly3Ka2PHBSYI= X-Google-Smtp-Source: AGHT+IFGXqrnOeKqyJ3yCJckvocrKsb0gM30Oxyynn0CiAx4Bp3STF3eSH3RxfQ/qVzdiG+/OksoAg== X-Received: by 2002:a05:620a:11ba:b0:77f:2d0b:4dbb with SMTP id c26-20020a05620a11ba00b0077f2d0b4dbbmr1382410qkk.32.1701875236570; Wed, 06 Dec 2023 07:07:16 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:16 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 3/9] auto-t: only call set_value for changed values in default() Date: Wed, 6 Dec 2023 07:07:02 -0800 Message-Id: <20231206150708.2080336-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The default() method was added for convenience but was extending the test times significantly when the hostapd config was lengthy. This was because it called set_value for every value regardless if it had changed. Instead store the current configuration and in default() only reset values that differ. --- autotests/util/hostapd.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py index 1b1bc399..cee08092 100644 --- a/autotests/util/hostapd.py +++ b/autotests/util/hostapd.py @@ -75,6 +75,8 @@ class HostapdCLI(object): if self._default_config.get('vendor_elements', None) == None: self._default_config['vendor_elements'] = '' + self._current_config = self._default_config.copy() + if not self.interface: raise Exception('config %s not found' % config) @@ -170,6 +172,8 @@ class HostapdCLI(object): if self._default_config.get(key, None) == None: raise Exception("Untracked setting '%s'! Please set default in hostapd config" % key) + self._current_config[key] = value + cmd = self.cmdline + ['set', key, value] ctx.start_process(cmd).wait() @@ -200,7 +204,10 @@ class HostapdCLI(object): def default(self): for k, v in self._default_config.items(): - self.set_value(k, v) + # Only bother setting the value if it differs + if self._current_config[k] != v: + self.set_value(k, v) + self._current_config[k] = v self.reload() From patchwork Wed Dec 6 15:07:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481922 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D436F3F8FE for ; Wed, 6 Dec 2023 15:07:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IFoiNmUO" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-77dc733b25cso417979885a.1 for ; Wed, 06 Dec 2023 07:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875238; x=1702480038; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C2VZUxX7utKd63GQ/iRjK0VbmkJFuijbHNmVwrfWouU=; b=IFoiNmUOOOHRiXLPesPD9ZvwyoV9gsx3uc6PMPoEmCkFqvq6eWRZGaftILvMuGTcvQ MOJThWAAgMRceInsWJyyywrTvacAQ8ci9DqZeI1VkFC7YeFam0fJFVSeXIufI/d/shQr wv3ZHYNJL4YvCPwIwswBTGRlSB+U1t2Kj+WCb/1VMeZOnR/K0sTrtMCt6XHyYFKjR/we llmLdQnDZN9BZPXVBeBLraGvNKGRBrrpa5eEXdAu4ETFNiLfmVqKgX0Yty5Mjw8XeQFP cHI0rD4rIAsd5rYyPV7+JMtzjkdev92pmWoYgoWcZqSTk+jPaCN21p6Evn314wTKd6qJ F2AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875238; x=1702480038; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C2VZUxX7utKd63GQ/iRjK0VbmkJFuijbHNmVwrfWouU=; b=r/7X+lJRPNZI1IUAqi9dwo++53/3dkF3kpYRqpWmNnAFZFwI3NXCigu0MgbWVm734e 0GBcRDIUzOIdkt5hXXHkBFXZe20l/NmuMEeVcq8ZcqsmrOeet/JiUpnxEE23tEzKvcag HDCxjACjajuK21iYMwUgKpzHdVvQ/vjTKCYMTv99VZ1WYhutEs1tt2g/gEdVJS/p2+6C kzYaAjElKzkYmhH0obkZl7P6fADH/nE7FzJ+aj9VB5x3j6RWPJaVOcycJnwXKDrTflyl nBJoZMgXwxSKcv8jrr6kT93gCJkJU2aGDpNh82a8CBemLIwXeO57G2X03j1wPlVSJsL3 pxOQ== X-Gm-Message-State: AOJu0Yw666tA3SyfxgT7CAlxjc+mvrf4kRF2zgRjHqfyR7Ogsjj3JFr/ 4dWjmvDhHUdTJii4S65IPy5wZwXY0K4= X-Google-Smtp-Source: AGHT+IH6d218raNDSoM6fOzBnBgdeGzgnzxQpG/xAgT2lCsNETTz+lgAvJdydUK14qL5vVZoYI45FA== X-Received: by 2002:a05:620a:46a3:b0:77f:14f:9988 with SMTP id bq35-20020a05620a46a300b0077f014f9988mr1301106qkb.101.1701875238448; Wed, 06 Dec 2023 07:07:18 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:17 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 4/9] ft: add FTE/RSNE building to ft_prepare_handshake Date: Wed, 6 Dec 2023 07:07:03 -0800 Message-Id: <20231206150708.2080336-5-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In preparation to remove ft_associate build the FTE/RSNE in ft_prepare_handshake and set into the handshake object directly. --- src/ft.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/src/ft.c b/src/ft.c index 2cc611b8..358a4594 100644 --- a/src/ft.c +++ b/src/ft.c @@ -904,9 +904,15 @@ static void ft_info_destroy(void *data) l_free(info); } -static void ft_prepare_handshake(struct ft_info *info, +static bool ft_prepare_handshake(struct ft_info *info, struct handshake_state *hs) { + uint32_t kck_len = handshake_state_get_kck_len(hs); + struct ie_rsn_info rsn_info; + struct ie_ft_info ft_info; + uint8_t *fte; + uint8_t *rsne; + handshake_state_set_authenticator_address(hs, info->aa); memcpy(hs->mde + 2, info->mde, 3); @@ -914,7 +920,7 @@ static void ft_prepare_handshake(struct ft_info *info, handshake_state_set_chandef(hs, NULL); if (!hs->supplicant_ie) - return; + return true; if (info->authenticator_ie) handshake_state_set_authenticator_ie(hs, @@ -931,6 +937,80 @@ static void ft_prepare_handshake(struct ft_info *info, info->ft_info.r1khid); handshake_state_derive_ptk(hs); + + /* + * Rebuild the RSNE to include the PMKR1Name and append + * MDE + FTE. + * + * 12.8.4: "If present, the RSNE shall be set as follows: + * - Version field shall be set to 1. + * - PMKID Count field shall be set to 1. + * - PMKID field shall contain the PMKR1Name. + * - All other fields shall be as specified in 8.4.2.27 + * and 11.5.3." + */ + if (ie_parse_rsne_from_data(hs->supplicant_ie, + hs->supplicant_ie[1] + 2, + &rsn_info) < 0) + return false; + + rsn_info.num_pmkids = 1; + rsn_info.pmkids = hs->pmk_r1_name; + /* Always set OCVC false for FT for now */ + rsn_info.ocvc = false; + rsne = alloca(256); + + ie_build_rsne(&rsn_info, rsne); + handshake_state_set_supplicant_ie(hs, rsne); + + /* + * 12.8.4: "If present, the FTE shall be set as follows: + * - ANonce, SNonce, R0KH-ID, and R1KH-ID shall be set to + * the values contained in the second message of this + * sequence. + * - The Element Count field of the MIC Control field shall + * be set to the number of elements protected in this + * frame (variable). + * [...] + * - All other fields shall be set to 0." + */ + memset(&ft_info, 0, sizeof(ft_info)); + ft_info.mic_element_count = 3; + memcpy(ft_info.r0khid, hs->r0khid, hs->r0khid_len); + ft_info.r0khid_len = hs->r0khid_len; + memcpy(ft_info.r1khid, hs->r1khid, 6); + ft_info.r1khid_present = true; + memcpy(ft_info.anonce, hs->anonce, 32); + memcpy(ft_info.snonce, hs->snonce, 32); + + /* + * IEEE 802.11-2020 Section 13.7.1 FT reassociation in an RSN + * + * "If dot11RSNAOperatingChannelValidationActivated is true and + * the FTO indicates OCVC capability, the target AP shall + * ensure that OCI subelement of the FTE matches by ensuring + * that all of the following are true: + * - OCI subelement is present + * - Channel information in the OCI matches current + * operating channel parameters (see 12.2.9)" + */ + if (hs->supplicant_ocvc && hs->chandef) { + oci_from_chandef(hs->chandef, ft_info.oci); + ft_info.oci_present = true; + } + + fte = alloca(256); + ie_build_fast_bss_transition(&ft_info, kck_len, fte); + + if (!ft_calculate_fte_mic(hs, 5, rsne, fte, NULL, ft_info.mic)) + return false; + + /* Rebuild the FT IE now with the MIC included */ + ie_build_fast_bss_transition(&ft_info, kck_len, fte); + + handshake_state_set_fte(hs, fte); + + return true; } static bool ft_send_action(struct wiphy_radio_work_item *work) From patchwork Wed Dec 6 15:07:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481923 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73B013EA88 for ; Wed, 6 Dec 2023 15:07:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eaGeufBi" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-77d895c298eso418079785a.3 for ; Wed, 06 Dec 2023 07:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875240; x=1702480040; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YVf/gROVm2ZHExMma5TWOl1N+2Pjgf0quNzQMceKAWQ=; b=eaGeufBi011VT8JWWsLR+7vSypTqh6H6I92l+uElz9dJThirLd+sztWIHyyllt+nea PmEZpmj9ji8CmEv0ynfVdLb7d1Ksq9EZW3JAAh/7aCuPyohtTQN9OXbEFVDyKEn3LCuj vPPFBMk7vv/wQmVHPufy49lC77EAqIpE1q/uAPVJ4XYzzVeWKWVMwXGyBSzVZVEeqMQ8 exDI+4bP9bIzG4Zy1vP+ngZKS1Kyt3F6TmhenJr6tfQH4/+uOdp6M9bu7w1rOs29SKmu F/Oq03lkR9iEM2/bjZnCtjent5ovDUh8/28cKWhytCTci979LtThJhTCPfWEn1JZ7Mny fYJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875240; x=1702480040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YVf/gROVm2ZHExMma5TWOl1N+2Pjgf0quNzQMceKAWQ=; b=fBREgCMeA+WFLXYZpuQOBCQyIbqOQZu3u5Jjr1Vne0zTknZgZTjB2+XCwFRmfjJTO1 FCCL349bdgAmk+NCOkSCiFCvP18fLwOY+XVQHC4RTTcHJb8TyS9GwNMXLH5MFB4M5+zb fjF/cOgFWu2ETgwAkz6WRQW2qVVwuIT9mdVjzd5BCBqTWkZLXl3NB8ykMFFtuqiY7ExV HUVQ0nUKwoUAEjkWEd3dEutNwBVEp2jsXy+mPQ6KCntEse2pEkDYluYpATfD377DbdXj VLANWou94M1S/qUai7GnntXaRNlfiQcX74UOO99LZkQB0CRAKhi0aamPgCaD4N4L0FDa X/iQ== X-Gm-Message-State: AOJu0YwMuFHbiYceMmLfsHlLYqdYulBtjq6DlwRSH6Q/tmO+kOksiRJt gLj5OqO0UpurpQhGw7aEtfnjG0AQin0= X-Google-Smtp-Source: AGHT+IEe7qMk/JgLxUjQVBE4RV6Ho05fDYWnTW/N8M9IaEN/PbpbjHr6KNRxlj8byef3N7YeJG1g8Q== X-Received: by 2002:a05:620a:2790:b0:77f:319b:a100 with SMTP id g16-20020a05620a279000b0077f319ba100mr851279qkp.59.1701875240050; Wed, 06 Dec 2023 07:07:20 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:19 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 5/9] ft: add ft_handshake_setup Date: Wed, 6 Dec 2023 07:07:04 -0800 Message-Id: <20231206150708.2080336-6-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This will be called from station after FT-authentication has finished. It sets up the handshake object to perform reassociation. This is essentially a copy-paste of ft_associate without sending the actual frame. --- src/ft.c | 32 ++++++++++++++++++++++++++++++++ src/ft.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/src/ft.c b/src/ft.c index 358a4594..738e08c3 100644 --- a/src/ft.c +++ b/src/ft.c @@ -1276,6 +1276,38 @@ int ft_associate(uint32_t ifindex, const uint8_t *addr) return ret; } +int ft_handshake_setup(uint32_t ifindex, const uint8_t *target) +{ + struct netdev *netdev = netdev_find(ifindex); + struct handshake_state *hs = netdev_get_handshake(netdev); + struct ft_info *info; + + info = ft_info_find(ifindex, target); + if (!info) + return -ENOENT; + + /* + * Either failed or no response. This may have been an FT-over-DS + * attempt so clear out the entry so FT-over-Air can try again. + */ + if (info->status != 0) { + int status = info->status; + + l_queue_remove(info_list, info); + ft_info_destroy(info); + + return status; + } + + if (L_WARN_ON(!ft_prepare_handshake(info, hs))) + return -EINVAL; + + /* After this no previous auths will be valid */ + ft_clear_authentications(ifindex); + + return 0; +} + static bool remove_ifindex(void *data, void *user_data) { struct ft_info *info = data; diff --git a/src/ft.h b/src/ft.h index 51bbe3bc..23d0136e 100644 --- a/src/ft.h +++ b/src/ft.h @@ -39,6 +39,8 @@ void __ft_rx_action(uint32_t ifindex, const uint8_t *frame, size_t frame_len); void __ft_rx_authenticate(uint32_t ifindex, const uint8_t *frame, size_t frame_len); +int ft_handshake_setup(uint32_t ifindex, const uint8_t *target); + void ft_clear_authentications(uint32_t ifindex); int ft_action(uint32_t ifindex, uint32_t freq, const struct scan_bss *target); int ft_associate(uint32_t ifindex, const uint8_t *addr); From patchwork Wed Dec 6 15:07:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481924 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B06E93EA9F for ; Wed, 6 Dec 2023 15:07:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ih9vvO0j" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-77d895c298eso418080985a.3 for ; Wed, 06 Dec 2023 07:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875241; x=1702480041; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3WIr59iK8+KfxkTwbfeDraxqS7unLhBzAqu5FX9Efps=; b=Ih9vvO0jv/vPBLSELWFuoB63Cnjl0AWRZLpKquQtPt0xo7bTTLQTuHvcgEQIGHGXni JE9Xrb0F7UX0g37yET+FFzDqC1P9R2Nk4fjGfBlCO1WUmXOIeTMVsRMIBES4WgOlBHvr lbJVgKknsyyf5p4SZFuHO5V1Iwow7AH/Psfg3uAUxTd3Bb7EUw2fEwGjiysgMBeeMYco kwvQ6jprXCVKML6PBBbQsZiEvedoj5Fx6iz52nuZh4zOK9QYZ+y5rWFw6J+ivP/WDjmm vb8s+87F00QZUty8J44d65mTzMsd0rvEYB/R/h6zN5ioADdj5FFKgR6m+/HRAN8YFkYv Lj5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875241; x=1702480041; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3WIr59iK8+KfxkTwbfeDraxqS7unLhBzAqu5FX9Efps=; b=MXvM9qWB3U2BydYhhyndiXbnXzPsLB+FizDzw/HJImQNJLOUALvskWzGcoXyDR8r6R qfG0TaKCSQuS4VsjEHpksKCF9QOZywqSh+cG+zX5C7Ds8obA1RmQdDb/JMPMC8gaEGAK m1m2uPhJtoZQ1sy+OT/zOPPBMCDkAaNf4cwrvFt9U9nyiy0ZAVweGfRAlzMr19rGQAYE GYNhPIazciV4q6jNPiLgOd/QXV9fPwWbtUn21aaLUomELMTCdcUqXw25ABW9KaKE4pCF 1q+7LieK6dZ95H6jxvgxyytHRxcvYfGu1RjbP0xwoiXezN99iuLKIa/3G4K4U+CgwXPn +gxQ== X-Gm-Message-State: AOJu0Yzg3ffzPkVGEYtt1KMySf0Mnjxpy+Qt+pzu4HypYsTqA5Vn83lq OFwsTOs+zQtxDucUfqppVs7SbQ44mrM= X-Google-Smtp-Source: AGHT+IHX34/S8xG/fc2ofd3pYhbUf+ouv6QmhtGhRNJzAyw5uBimtoOvYAd6xRiNY/+c/tx83etdhA== X-Received: by 2002:a05:620a:8d10:b0:77d:c8d2:7f18 with SMTP id rb16-20020a05620a8d1000b0077dc8d27f18mr1013823qkn.28.1701875241282; Wed, 06 Dec 2023 07:07:21 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:20 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 6/9] netdev: add netdev_ft_reassociate Date: Wed, 6 Dec 2023 07:07:05 -0800 Message-Id: <20231206150708.2080336-7-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Essentially exposes (and renames) netdev_ft_tx_associate in order to be called similarly to netdev_reassociate/netdev_connect where a connect callback can be provided. This will fix the current bug where if association times out during FT IWD will hang and never transition to disconnected. This also removes the calling of the FT_ROAMED event and instead just calls the connect callback (since its now set). This unifies the callback path for reassociation and FT roaming. --- src/netdev.c | 44 ++++++++++++++++++++++++++------------------ src/netdev.h | 5 +++++ 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index f2e887b4..7d52ffea 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1409,16 +1409,14 @@ static void netdev_connect_ok(struct netdev *netdev) scan_bss_free(netdev->fw_roam_bss); netdev->fw_roam_bss = NULL; - } else if (netdev->in_ft) { - if (netdev->event_filter) - netdev->event_filter(netdev, NETDEV_EVENT_FT_ROAMED, - NULL, netdev->user_data); - netdev->in_ft = false; } else if (netdev->connect_cb) { netdev->connect_cb(netdev, NETDEV_RESULT_OK, NULL, netdev->user_data); netdev->connect_cb = NULL; - } + netdev->in_ft = false; + netdev->in_reassoc = false; + } else + l_warn("Connection event without a connect callback!"); netdev_rssi_polling_update(netdev); @@ -4205,13 +4203,14 @@ static int netdev_tx_ft_frame(uint32_t ifindex, uint16_t frame_type, return 0; } -static int netdev_ft_tx_associate(uint32_t ifindex, uint32_t freq, - const uint8_t *prev_bssid, - struct iovec *ft_iov, size_t n_ft_iov) +int netdev_ft_reassociate(struct netdev *netdev, + const struct scan_bss *target_bss, + const struct scan_bss *orig_bss, + netdev_event_func_t event_filter, + netdev_connect_cb_t cb, void *user_data) { - struct netdev *netdev = netdev_find(ifindex); - struct netdev_handshake_state *nhs; struct handshake_state *hs = netdev->handshake; + struct netdev_handshake_state *nhs; struct l_genl_msg *msg; struct iovec iov[64]; unsigned int n_iov = L_ARRAY_SIZE(iov); @@ -4223,11 +4222,14 @@ static int netdev_ft_tx_associate(uint32_t ifindex, uint32_t freq, * At this point there is no going back with FT so reset all the flags * needed to associate with a new BSS. */ - netdev->frequency = freq; + netdev->frequency = target_bss->frequency; netdev->handshake->active_tk_index = 0; netdev->associated = false; netdev->operational = false; netdev->in_ft = true; + netdev->event_filter = event_filter; + netdev->connect_cb = cb; + netdev->user_data = user_data; /* * Cancel commands that could be running because of EAPoL activity @@ -4271,15 +4273,22 @@ static int netdev_ft_tx_associate(uint32_t ifindex, uint32_t freq, c_iov = netdev_populate_common_ies(netdev, hs, msg, iov, n_iov, c_iov); - if (!L_WARN_ON(n_iov - c_iov < n_ft_iov)) { - memcpy(iov + c_iov, ft_iov, sizeof(*ft_iov) * n_ft_iov); - c_iov += n_ft_iov; - } + if (hs->supplicant_ie) + c_iov = iov_ie_append(iov, n_iov, c_iov, hs->supplicant_ie, + IE_LEN(hs->supplicant_ie)); + + if (hs->fte) + c_iov = iov_ie_append(iov, n_iov, c_iov, hs->fte, + IE_LEN(hs->fte)); + + if (hs->mde) + c_iov = iov_ie_append(iov, n_iov, c_iov, hs->mde, + IE_LEN(hs->mde)); mpdu_sort_ies(subtype, iov, c_iov); l_genl_msg_append_attr(msg, NL80211_ATTR_PREV_BSSID, ETH_ALEN, - prev_bssid); + orig_bss->addr); l_genl_msg_append_attrv(msg, NL80211_ATTR_IE, iov, c_iov); netdev->connect_cmd_id = l_genl_family_send(nl80211, msg, @@ -6256,7 +6265,6 @@ static int netdev_init(void) __eapol_set_install_pmk_func(netdev_set_pmk); __ft_set_tx_frame_func(netdev_tx_ft_frame); - __ft_set_tx_associate_func(netdev_ft_tx_associate); unicast_watch = l_genl_add_unicast_watch(genl, NL80211_GENL_NAME, netdev_unicast_notify, diff --git a/src/netdev.h b/src/netdev.h index 03d1b6e9..fb31b571 100644 --- a/src/netdev.h +++ b/src/netdev.h @@ -165,6 +165,11 @@ int netdev_reassociate(struct netdev *netdev, struct handshake_state *hs, netdev_event_func_t event_filter, netdev_connect_cb_t cb, void *user_data); +int netdev_ft_reassociate(struct netdev *netdev, + const struct scan_bss *target_bss, + const struct scan_bss *orig_bss, + netdev_event_func_t event_filter, + netdev_connect_cb_t cb, void *user_data); int netdev_preauthenticate(struct netdev *netdev, const struct scan_bss *target_bss, From patchwork Wed Dec 6 15:07:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481925 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18B0B3EA88 for ; Wed, 6 Dec 2023 15:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RmwDufAn" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-77d895c298eso418082485a.3 for ; Wed, 06 Dec 2023 07:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875243; x=1702480043; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BP2GXecCLTCwhtG6lubs+kIXOz4u2K6hWAydD47yba8=; b=RmwDufAnMIg1h6olqH6faFbrtPSHIG9FV2yCprfli/nax8LWm6GeFA7C945ZPFt+Qy 2MxjEr0DyVGSZYSmkOdiIsPsgIriC+qy4Sg0v9hIcsZXaIShF0G/83bzw0Dm7kDzQqw4 uU1Q/qswM2uK30TN67QGA7kmlZi/gUo4wbo8I6s5u5/rI2OC/zSvidjFvt4GUiYSPZos lv70Lr9dB6316zNAaVFZfwNRZpeeEhHjz/rXKP6A4b2VFFFM+ydNDpgKbs8q9VAJECj+ 4QsglXdzQ+7SD2p9zm3QIgxJt0h7HpUwzlPvfuTW5XAl23cFsJceV/I0GLmlLW5zkrVI rTTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875243; x=1702480043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BP2GXecCLTCwhtG6lubs+kIXOz4u2K6hWAydD47yba8=; b=g1OXWg1HdKgMXre9sIyYWuHKLMee4DW7gYAjSQo5mmASi+jD7lDrnAlig4C2m1eOp+ PPsLBq2hDPHIOLJKsJK12R9GE/iFYOPQhh5uihTqlQrmqHFcg2srdYmsBFHyntYra23C mh7w9tGS0cFdpROnKidyYeGIRZDZMBtkYoUbWszlP7qIP0h/8ynTG1LtavLLup14ocB2 taccXnrw0Zr68E4Gm3GmYocVi8DDCNdUh5tpm+up24lWAK0c+uZeMwAl7eKgBh3sVtEC Ww1DZyM49QStNwIlSNhyXMXYe/CPcL8XS2zQCjJ6d5Qe8ftbzpOtTsEiBn0VjYfTXVKx hMYQ== X-Gm-Message-State: AOJu0Yz0XoKR4ecEIoVr2ytWFnbCRjJ8/6LywuV/VLcKCe2UvU9dm8ib VC160Qz5tqOKnYRLJAZAGOXr1pq1p40= X-Google-Smtp-Source: AGHT+IH0xcpCfe66ATtslLL/0MEHVDfEZK4/diqb0+YIYol6tYENcpIgpoM8MlXyNtEAL4iOZWExWg== X-Received: by 2002:a05:620a:55b0:b0:77e:fba3:4efc with SMTP id vr16-20020a05620a55b000b0077efba34efcmr1066005qkn.82.1701875242460; Wed, 06 Dec 2023 07:07:22 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:22 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 7/9] station: use netdev_ft_reassociate Date: Wed, 6 Dec 2023 07:07:06 -0800 Message-Id: <20231206150708.2080336-8-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Using this will provide netdev with a connect callback and unify the roaming result notification between FT and reassociation. Both paths will now end up in station_reassociate_cb. Fixes: 30c6a10f28 ("netdev: Separate connect_failed and disconnected paths") --- src/station.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/station.c b/src/station.c index 48a595dc..b5e78a37 100644 --- a/src/station.c +++ b/src/station.c @@ -2181,7 +2181,8 @@ static void station_reassociate_cb(struct netdev *netdev, l_debug("%u, result: %d", netdev_get_ifindex(station->netdev), result); - if (station->state != STATION_STATE_ROAMING) + if (station->state != STATION_STATE_ROAMING && + station->state != STATION_STATE_FT_ROAMING) return; if (result == NETDEV_RESULT_OK) @@ -2314,7 +2315,8 @@ static bool station_ft_work_ready(struct wiphy_radio_work_item *item) if (!bss) goto try_next; - ret = ft_associate(netdev_get_ifindex(station->netdev), bss->addr); + ret = ft_handshake_setup(netdev_get_ifindex(station->netdev), + bss->addr); switch (ret) { case MMPDU_STATUS_CODE_INVALID_PMKID: /* @@ -2343,6 +2345,13 @@ try_next: station_transition_start(station); break; case 0: + ret = netdev_ft_reassociate(station->netdev, bss, + station->connected_bss, + station_netdev_event, + station_reassociate_cb, station); + if (ret < 0) + goto roam_failed; + station->connected_bss = bss; station->preparing_roam = false; station_enter_state(station, STATION_STATE_FT_ROAMING); @@ -2354,6 +2363,7 @@ try_next: if (ret > 0) goto try_next; +roam_failed: station_roam_failed(station); break; } From patchwork Wed Dec 6 15:07:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481926 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95EC23EA9A for ; Wed, 6 Dec 2023 15:07:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aBS4cx53" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-77f391c96c8so3161285a.0 for ; Wed, 06 Dec 2023 07:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875244; x=1702480044; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F76txXl0Lz9+jyQuBRiv0Gmf26qPnZ580WlyjFMVyXM=; b=aBS4cx53OufdtecTztAyAzLol5p9BJIdIMYN8R/WVkx11IH8/TpwzOMjHkhQ1w2Dd9 npPU88g3GdbW6a1r9qP0tt4gP3pDgGv35m4CUzNvmWnl++NT7CZ5dWKQR7xSnRsTkP2L zGmAwfkqxowU3wQHAb4NXlhNJ29AVxZ6OdBlr4jni2CvWqGxl/88CYsT+56rvYXOVhFc cb1y01EOdTeCSYiYcBBneSQIoYd0idSg/yxhsYfDYJ6+sYz3+tLk7M57PxBKviN2gHiT 1CTyL30kMXCZLA0vYTGdpRm27QPI/Bpokiad5u3zSg1yE8JntET7nTddlgHO0FSMslXK mzBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875244; x=1702480044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F76txXl0Lz9+jyQuBRiv0Gmf26qPnZ580WlyjFMVyXM=; b=AyExgzoTKr7piW1bVZTcga8qGTe1a1uhprMJQgq3SlP0lB+CGOYmUiAiAuf/CFNWGW G4DKBjCYw6823WpKFj53adowanC7jPujzqcIAjCT38gimZu2WoLikiuSbYAFBERwcE5k NW5GF463GrjXCsR0rBUL5tsnIg3tQDGESmmnev08WpiVpHHsPup+eItyOh+o9JT9cFtA 9G+ABn3P+5Nmjvr/ISsNuQOkyXVQWARLrlkV2jtEO+e1kXkqs7ZqgYAXUYnzgmcgcvq4 yN2g3lmo8+wVSfu8QZXeVa7/2ZFznhZwhKkjMxLSOsVQ8ErCYbh7mFfJlcpqOb1FeZYT NkzQ== X-Gm-Message-State: AOJu0YyiX0hbKd2GnVxo6wHEUqx7VJpFpuUSd7H1C5NgdFVzvOQiiZPJ 26WGfK/7nmdEb4Ts1IOhbIt92ssOjmc= X-Google-Smtp-Source: AGHT+IEvtWOLQuTA+vgce5nrWz/tbzEqUafoXu6S4/dvamGnlYFNiFzkHmH9QI43z6Z8cWPKQ/57Kg== X-Received: by 2002:a05:620a:3996:b0:77e:fba3:9d21 with SMTP id ro22-20020a05620a399600b0077efba39d21mr897147qkn.133.1701875244098; Wed, 06 Dec 2023 07:07:24 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:23 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 8/9] ft: remove ft_associate and helpers Date: Wed, 6 Dec 2023 07:07:07 -0800 Message-Id: <20231206150708.2080336-9-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The reassociation is done through netdev directly, these are no longer needed. --- src/ft.c | 160 +------------------------------------------------------ src/ft.h | 2 - 2 files changed, 1 insertion(+), 161 deletions(-) diff --git a/src/ft.c b/src/ft.c index 738e08c3..add6a42b 100644 --- a/src/ft.c +++ b/src/ft.c @@ -43,7 +43,6 @@ static const unsigned int FT_ONCHANNEL_TIME = 300u; /* ms */ static ft_tx_frame_func_t tx_frame = NULL; -static ft_tx_associate_func_t tx_assoc = NULL; static struct l_queue *info_list = NULL; struct ft_info { @@ -224,117 +223,6 @@ static bool ft_parse_associate_resp_frame(const uint8_t *frame, size_t frame_len return true; } -static int ft_tx_reassociate(uint32_t ifindex, uint32_t freq, - const uint8_t *prev_bssid) -{ - struct netdev *netdev = netdev_find(ifindex); - struct handshake_state *hs = netdev_get_handshake(netdev); - struct iovec iov[3]; - int iov_elems = 0; - uint32_t kck_len = handshake_state_get_kck_len(hs); - bool is_rsn = hs->supplicant_ie != NULL; - uint8_t *rsne = NULL; - - if (is_rsn) { - struct ie_rsn_info rsn_info; - - /* - * Rebuild the RSNE to include the PMKR1Name and append - * MDE + FTE. - * - * 12.8.4: "If present, the RSNE shall be set as follows: - * - Version field shall be set to 1. - * - PMKID Count field shall be set to 1. - * - PMKID field shall contain the PMKR1Name. - * - All other fields shall be as specified in 8.4.2.27 - * and 11.5.3." - */ - if (ie_parse_rsne_from_data(hs->supplicant_ie, - hs->supplicant_ie[1] + 2, - &rsn_info) < 0) - goto error; - - rsn_info.num_pmkids = 1; - rsn_info.pmkids = hs->pmk_r1_name; - - /* Always set OCVC false for FT for now */ - rsn_info.ocvc = false; - - rsne = alloca(256); - ie_build_rsne(&rsn_info, rsne); - - iov[iov_elems].iov_base = rsne; - iov[iov_elems].iov_len = rsne[1] + 2; - iov_elems += 1; - } - - /* The MDE advertised by the BSS must be passed verbatim */ - iov[iov_elems].iov_base = (void *) hs->mde; - iov[iov_elems].iov_len = hs->mde[1] + 2; - iov_elems += 1; - - if (is_rsn) { - struct ie_ft_info ft_info; - uint8_t *fte; - - /* - * 12.8.4: "If present, the FTE shall be set as follows: - * - ANonce, SNonce, R0KH-ID, and R1KH-ID shall be set to - * the values contained in the second message of this - * sequence. - * - The Element Count field of the MIC Control field shall - * be set to the number of elements protected in this - * frame (variable). - * [...] - * - All other fields shall be set to 0." - */ - - memset(&ft_info, 0, sizeof(ft_info)); - - ft_info.mic_element_count = 3; - memcpy(ft_info.r0khid, hs->r0khid, hs->r0khid_len); - ft_info.r0khid_len = hs->r0khid_len; - memcpy(ft_info.r1khid, hs->r1khid, 6); - ft_info.r1khid_present = true; - memcpy(ft_info.anonce, hs->anonce, 32); - memcpy(ft_info.snonce, hs->snonce, 32); - - /* - * IEEE 802.11-2020 Section 13.7.1 FT reassociation in an RSN - * - * "If dot11RSNAOperatingChannelValidationActivated is true and - * the FTO indicates OCVC capability, the target AP shall - * ensure that OCI subelement of the FTE matches by ensuring - * that all of the following are true: - * - OCI subelement is present - * - Channel information in the OCI matches current - * operating channel parameters (see 12.2.9)" - */ - if (hs->supplicant_ocvc && hs->chandef) { - oci_from_chandef(hs->chandef, ft_info.oci); - ft_info.oci_present = true; - } - - fte = alloca(256); - ie_build_fast_bss_transition(&ft_info, kck_len, fte); - - if (!ft_calculate_fte_mic(hs, 5, rsne, fte, NULL, ft_info.mic)) - goto error; - - /* Rebuild the FT IE now with the MIC included */ - ie_build_fast_bss_transition(&ft_info, kck_len, fte); - - iov[iov_elems].iov_base = fte; - iov[iov_elems].iov_len = fte[1] + 2; - iov_elems += 1; - } - - return tx_assoc(ifindex, freq, prev_bssid, iov, iov_elems); - -error: - return -EINVAL; -} - static bool ft_verify_rsne(const uint8_t *rsne, const uint8_t *pmk_r0_name, const uint8_t *authenticator_ie) { @@ -762,11 +650,6 @@ void __ft_set_tx_frame_func(ft_tx_frame_func_t func) tx_frame = func; } -void __ft_set_tx_associate_func(ft_tx_associate_func_t func) -{ - tx_assoc = func; -} - static bool ft_parse_ies(struct ft_info *info, struct handshake_state *hs, const uint8_t *ies, size_t ies_len) { @@ -1173,7 +1056,7 @@ static void ft_authenticate_destroy(int error, void *user_data) /* * There is no callback here because its assumed that another work item will * be inserted following this call which will check if authentication succeeded - * via ft_associate. + * via ft_handshake_setup. * * If the netdev goes away while authentication is in-flight station will clear * the authentications during cleanup, and in turn cancel the offchannel @@ -1235,47 +1118,6 @@ int ft_authenticate_onchannel(uint32_t ifindex, const struct scan_bss *target) return 0; } -int ft_associate(uint32_t ifindex, const uint8_t *addr) -{ - struct netdev *netdev = netdev_find(ifindex); - struct handshake_state *hs = netdev_get_handshake(netdev); - struct ft_info *info; - int ret; - - /* - * TODO: Since FT-over-DS is done early, before the time of roaming, it - * may end up that a completely new BSS is the best candidate and - * we haven't yet authenticated. We could actually authenticate - * at this point, but for now just assume the caller will choose - * a different BSS. - */ - info = ft_info_find(ifindex, addr); - if (!info) - return -ENOENT; - - /* - * Either failed or no response. This may have been an FT-over-DS - * attempt so clear out the entry so FT-over-Air can try again. - */ - if (info->status != 0) { - int status = info->status; - - l_queue_remove(info_list, info); - ft_info_destroy(info); - - return status; - } - - ft_prepare_handshake(info, hs); - - ret = ft_tx_reassociate(ifindex, info->frequency, info->prev_bssid); - - /* After this no previous auths will be valid */ - ft_clear_authentications(ifindex); - - return ret; -} - int ft_handshake_setup(uint32_t ifindex, const uint8_t *target) { struct netdev *netdev = netdev_find(ifindex); diff --git a/src/ft.h b/src/ft.h index 23d0136e..92c207fb 100644 --- a/src/ft.h +++ b/src/ft.h @@ -32,7 +32,6 @@ typedef int (*ft_tx_associate_func_t)(uint32_t ifindex, uint32_t freq, struct iovec *ie_iov, size_t iov_len); void __ft_set_tx_frame_func(ft_tx_frame_func_t func); -void __ft_set_tx_associate_func(ft_tx_associate_func_t func); int __ft_rx_associate(uint32_t ifindex, const uint8_t *frame, size_t frame_len); void __ft_rx_action(uint32_t ifindex, const uint8_t *frame, size_t frame_len); @@ -43,6 +42,5 @@ int ft_handshake_setup(uint32_t ifindex, const uint8_t *target); void ft_clear_authentications(uint32_t ifindex); int ft_action(uint32_t ifindex, uint32_t freq, const struct scan_bss *target); -int ft_associate(uint32_t ifindex, const uint8_t *addr); int ft_authenticate(uint32_t ifindex, const struct scan_bss *target); int ft_authenticate_onchannel(uint32_t ifindex, const struct scan_bss *target); From patchwork Wed Dec 6 15:07:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13481927 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C91A23EA88 for ; Wed, 6 Dec 2023 15:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Iw3Woq8w" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-77dce4d41d5so373353585a.3 for ; Wed, 06 Dec 2023 07:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701875246; x=1702480046; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dh4q3U8aR5wWiqh479HUG4F7x1/MlU5Z12kadUzRPE8=; b=Iw3Woq8wu9jnuOxANgSnecvLzEj093qF8eJqZS3/rfbS9EHBSxZVKXCRf7IeZ5SbWN ixLaNhnEERHYOw+Cj9PttXnVOeFA4Bh7mz8SjZ9MM2pe06STtf0DUpibtxREnZYeUqK/ ip0tPiyIOeuGoEodkH5ff6LnQGqmSowDEADI3W5aOYOXdSOrahVD+cyQNNosSc4pyx3W mPKWONaRTE4sHX4DV14KkGfR5sLb89tcm9t7fH1t6KCkznK5ViEzAI64q8s8zGdplPkH 1YIsru7CSjictlAs2q9Xa2q4EwnAoqCG9UOWh51/+cASP5bPDc+Xjk6DEmXb+Aye8eSi 6Ijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701875246; x=1702480046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dh4q3U8aR5wWiqh479HUG4F7x1/MlU5Z12kadUzRPE8=; b=HcvZGUn7JM3h9SBJLTlNLh2h2Anb5PxjFEVj7XXJlVKp9ye8sJ5QOCJv3g8Vid08ql AHr/xMpgLFFx61NYlmqsEjLr1Z1rDJLcZx6EX/HOJHgBsB9zO4wFp1Rm5s7aNTvskHhF MqdYfIDY5ncfznTy9ER5yNpxgV26WL+N403Wb2GvxG/koTe6CdQjTzLw5LrrKbJnfIWo +lRJmU2kSuqFP2N5sRXyN62xk5QstPm2whBEEq6wcrihJv9zRTm+WLRc7FrUNjSTCjmx EYRy53uhXdhZusYBoOIY+9KVaY5wqALJ0E7REYRGiVUUJLnKo4L5mpeLdAsHz/lNwmgw WZ1g== X-Gm-Message-State: AOJu0YxCDy/rt6k0SyBCFp6VGQU2ykvfxCAziF5Ejl32wExpQJgBIDP8 ghnPymaNZThzHvt0ZIUOz4BTZSPPf14= X-Google-Smtp-Source: AGHT+IGhx398W97XwJwCrrcgULXY4cT2VwbJwVVTt/UNTOXUQ9DEDQ+0caSwW3TIiOnHHvi7p828bA== X-Received: by 2002:ae9:e517:0:b0:77d:c7f6:679 with SMTP id w23-20020ae9e517000000b0077dc7f60679mr1058057qkf.58.1701875245608; Wed, 06 Dec 2023 07:07:25 -0800 (PST) Received: from LOCLAP699.rst-02.locus (50-78-19-50-static.hfc.comcastbusiness.net. [50.78.19.50]) by smtp.gmail.com with ESMTPSA id vy22-20020a05620a491600b0077d66277e9asm11506qkn.116.2023.12.06.07.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:07:25 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 9/9] netdev: station: remove NETDEV_EVENT_FT_ROAMED Date: Wed, 6 Dec 2023 07:07:08 -0800 Message-Id: <20231206150708.2080336-10-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206150708.2080336-1-prestwoj@gmail.com> References: <20231206150708.2080336-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The notification for roaming success/failure is now handled with the connect callback. --- src/netdev.h | 1 - src/station.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/src/netdev.h b/src/netdev.h index fb31b571..d87f09f4 100644 --- a/src/netdev.h +++ b/src/netdev.h @@ -50,7 +50,6 @@ enum netdev_event { NETDEV_EVENT_RSSI_THRESHOLD_HIGH, NETDEV_EVENT_RSSI_LEVEL_NOTIFY, NETDEV_EVENT_PACKET_LOSS_NOTIFY, - NETDEV_EVENT_FT_ROAMED, NETDEV_EVENT_BEACON_LOSS_NOTIFY, }; diff --git a/src/station.c b/src/station.c index b5e78a37..f5d6914f 100644 --- a/src/station.c +++ b/src/station.c @@ -3436,12 +3436,6 @@ static void station_netdev_event(struct netdev *netdev, enum netdev_event event, case NETDEV_EVENT_PACKET_LOSS_NOTIFY: station_packets_lost(station, l_get_u32(event_data)); break; - case NETDEV_EVENT_FT_ROAMED: - if (L_WARN_ON(station->state != STATION_STATE_FT_ROAMING)) - return; - - station_roamed(station); - break; case NETDEV_EVENT_BEACON_LOSS_NOTIFY: station_beacon_lost(station); break;