From patchwork Thu Jul 18 11:45:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736412 Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (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 F3D5B13AA5D for ; Thu, 18 Jul 2024 11:45:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303122; cv=none; b=UQ2LhJUCyP49L4v1iBptEzU2YanBDYQXu2LSJMiovJOvlSLLte7P1WjFOuRdz0yJ4scfEmd4poav9elq5uGRdHaN/OAsJc1cMDvx1GHDkFKpOQrUsaiZb44I9ig7xTaF7oIRd5nxNxbFDWhtGOzSGUVUvuSiPLbppar5LeF8dcs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303122; c=relaxed/simple; bh=UrwEPTXWo7X5+8wjdxyu7T9hXlAnwefwROVAdXlnRrc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BMSBcKVhAGDf/ofeNek5wyTwNp8FWqkIVjFU6ymG6s72grRAUipEu1MOWGPUGVClTNUg5OMe18OkOpmOIIiKYGpGkoPSYbb7mGJI26FGB/WOO+LW+PDN15tIi63PGMlhwTqZZnPm1ubEmfYlW2loqykTH9gn9ofmypA5AUUMucg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WsjfdxqL; arc=none smtp.client-ip=209.85.219.176 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="WsjfdxqL" Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-e05a2949284so697235276.1 for ; Thu, 18 Jul 2024 04:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303120; x=1721907920; 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=kdisNiv81zFmrAFtxMDr6J899+B4KH4hNn79r3VP1ik=; b=WsjfdxqLtGsZ1Tz6w34VklIc8inG02wR+7xw6MIw0EThT/gTyE2nmvnYvKW8vN7wZh iSizqI5PTUu7wJTLNM8tMzZjRSp3+Lkr5cqDQyBmw17u5n22d6TJD/zqrvkmRQ4G15SG qeJDzsu1EEatsno0+uY2L5lL4I1bgpJ8xVMqBZ015N9gWLAizX4pMyCJFqApqsFGdQL8 RcYJNlAX9ZR7v1X8kCZ1hbQpBetumfs+Nmi4xxL+pmjenctuUFYgpnkf9AV7pvfE3Rcx 6r+6snuTovzQckmfBFwS9Ulle7VdJrISObvQ+2j7jUOINccW83U9ea1k08Hl9J81fBt+ xlpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303120; x=1721907920; 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=kdisNiv81zFmrAFtxMDr6J899+B4KH4hNn79r3VP1ik=; b=sKgcRHleaByl43ja5lioO+Z+btpFkTZqZB0bKJdK1WSk/eI9euPa+mSYcjXoNpEO7P mbotZax07NvRDPWaMe9w2r8oq/PzoPkzRcHPdIKwgQGQwiyyr4QeAlnCJT78KMc0By41 7+1OaocL1LwU7LhQISjYQ47HPfdnldMblDU5GGY22MpQgS8P1TgZ4NfTpOWo2FSiBecb ByUi3weD0xlhbKbG9wWFNvj/AzOUqiWIgYsmQQpGJWTycui+KZZSNVkIiN/SeykvG3HX XHyK8n8MXUVlJUUdInLVK5AeGVrwqDuGm082zBLb7iyqKq5/9NcMq68w7XE1v8SN+aoR uvkw== X-Gm-Message-State: AOJu0YzBr30MRcFk55PRRT712WzRY3046gA5yo8wuKLECLqRWNXrZn5N QZdDilPMcCCwvwQrFz+Y5gXpxsaZupLV5flw4GXbvEJ85qIufTT/eDEwbw== X-Google-Smtp-Source: AGHT+IEgZyy1cNepK5w7ssGtXZdFWLXWFjV/QiCldGJcAocYSHifUJNZs7r/cE77E6an583AQl8vMw== X-Received: by 2002:a05:6902:12cc:b0:e03:9b03:f749 with SMTP id 3f1490d57ef6-e05feaf0295mr3018976276.23.1721303119759; Thu, 18 Jul 2024 04:45:19 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:19 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 01/11] station: print unknown channel number in neighbor report Date: Thu, 18 Jul 2024 04:45:04 -0700 Message-Id: <20240718114514.2916258-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If the channel number resulted in a failure to parse the neighbor report entry, print it for debugging. --- src/station.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/station.c b/src/station.c index 509d919c..3ead4326 100644 --- a/src/station.c +++ b/src/station.c @@ -1835,7 +1835,7 @@ static uint32_t station_freq_from_neighbor_report(const uint8_t *country, band = BAND_FREQ_5_GHZ; else { l_debug("Ignored: 0 oper class with an unusual " - "channel number"); + "channel number %u", info->channel_num); return 0; } From patchwork Thu Jul 18 11:45:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736413 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (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 2BC4313B288 for ; Thu, 18 Jul 2024 11:45:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303123; cv=none; b=NUwjK5T5Ur3FjyL3bQMOt4YNHOQ/yoBAQmx/3BWVnWMhX6+JP+Of/LB8zD01ozEimm4tnjQ6h665OK87Gn/tE03E/rbRwuoB8WcI5KMf1C8JRJ7Jkf15t2kOQynQg1rdaIfQQpMfqSuldjwhpRLfZpfQDUXFlP3rRz96WasY38o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303123; c=relaxed/simple; bh=JreGr0sHLZLl4XeUk5L1hDKAt+cr/UAmnzI7wM9H2Ps=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lOme1F/KZTM3DUrX8bgAgrm7s0Ubpr9xrUFvq0fMBkVVJirGx9Eu08GsbZPt9YDGQNAP4xzbsxS4IJhLkEAxq7JMNzi0Gsi5CdQmT6eV4PYfK67bOyEvvLBZ8HSxEyT+fLZw0Lagx+TtNAggbl7TLggE2k8P+zRS/2FN5xq3OQ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XyeNk5BK; arc=none smtp.client-ip=209.85.219.41 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="XyeNk5BK" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-6b78c980981so3966736d6.2 for ; Thu, 18 Jul 2024 04:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303121; x=1721907921; 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=R2woAQ/OajhFJ9iSHb0ikY2m+Ui2/rCm2lDgkMgMWzc=; b=XyeNk5BKiCn8uW9fBqeJl8hdmH05Q6LpeMo/+dnyhDJxCSXGoZsrpnHIVGwnW6HxAC AWvfGFjuyYzMbhObIBzSdVWiY21/rLsYgOgwC8GHNkeqrPRWxZnEja6LNvJ/YVJvDmyn qWYAp0GB3C+vN3Fa6RK8UKM8eddCoB7PKwpmCC41bJs2S7Key0PUEG/klqb5WqiLnfqJ NjqQH9ll+mYrlsCZ/kxwTZIa0kpJkokBWsWhuoxiU1WxJgxsA/WvtqM0k9XsMM3EyZGu bg+6hWFRjnVD80gerlPdFWRWlgFJa+XJoXFS+zPgPmojNPZxyPkP5l9OOuzNVJH6+jJS hMgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303121; x=1721907921; 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=R2woAQ/OajhFJ9iSHb0ikY2m+Ui2/rCm2lDgkMgMWzc=; b=c0hkGJPBJG0uB9VR2O6xk5C44PYtR/Gc1142BcZq7w3JWVH4H1lQyxcxQtCTrQarr6 EvXL5baG7OapasMCCVTcw9DcT9GpM02yKcQPwNWib22aT+a0B1Etw8qdXVkC3/mPYNw+ sPAZy5V8RgJUHSkAyQAFjIUo+yJXCaVEv0EBQncu8Bnt/or5Vngw8Pl4hkByCNRLgnQE zukaPf2VzePdRAZVt/IAC7YmsERJUDjifeF8nyMXQiiyFbc6ZqdAxpvab4HHIq8mvrOk 8NDhjCLwwkO25DeNvd3ANNQ321XatU8Cmjni0iaTbdpfoSeM6iAyn7oZRtyFtEd8En91 5xKA== X-Gm-Message-State: AOJu0Yz04g1Qb4pjDjEIISjsZL/jAt8oF4LZuiknTDtlhf3PeOU1lFLX SV/db+oHQfspQmx0dVptHbysKHetaNKMDkcoRBLIj+NYACFrqiu0fV9CeQ== X-Google-Smtp-Source: AGHT+IHJEJ/YlGJUQepGunHpBUBBENtPX58g1Fmt4Vr67orhOzlCCCGymIV3GWtcJKgp6JjuUCVd8Q== X-Received: by 2002:ad4:5be8:0:b0:6b5:da13:bf42 with SMTP id 6a1803df08f44-6b78e464d26mr53253566d6.58.1721303120825; Thu, 18 Jul 2024 04:45:20 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:20 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 02/11] netdev: add NETDEV_RESULT_DISCONNECTED Date: Thu, 18 Jul 2024 04:45:05 -0700 Message-Id: <20240718114514.2916258-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This new result is meant to handle cases where a disconnect event (deauth/disassoc) was received during an ongoing connection. Whether that's during authentication, association, the 4-way handshake, or key setting. --- src/netdev.h | 2 ++ src/p2p.c | 1 + src/station.c | 1 + 3 files changed, 4 insertions(+) diff --git a/src/netdev.h b/src/netdev.h index 671d0d40..db0440d0 100644 --- a/src/netdev.h +++ b/src/netdev.h @@ -36,6 +36,7 @@ enum netdev_result { NETDEV_RESULT_HANDSHAKE_FAILED, NETDEV_RESULT_KEY_SETTING_FAILED, NETDEV_RESULT_ABORTED, + NETDEV_RESULT_DISCONNECTED, }; enum netdev_event { @@ -86,6 +87,7 @@ typedef void (*netdev_command_cb_t)(struct netdev *netdev, int result, * NETDEV_RESULT_HANDSHAKE_FAILED - MMPDU_REASON_CODE * NETDEV_RESULT_KEY_SETTING_FAILED - unused * NETDEV_RESULT_ABORTED - unused. + * NETDEV_RESULT_DISCONNECTED - MMPDU_REASON_CODE */ typedef void (*netdev_connect_cb_t)(struct netdev *netdev, enum netdev_result result, diff --git a/src/p2p.c b/src/p2p.c index 205d4fcb..e8c7c5de 100644 --- a/src/p2p.c +++ b/src/p2p.c @@ -1366,6 +1366,7 @@ static void p2p_netdev_connect_cb(struct netdev *netdev, case NETDEV_RESULT_ASSOCIATION_FAILED: case NETDEV_RESULT_HANDSHAKE_FAILED: case NETDEV_RESULT_KEY_SETTING_FAILED: + case NETDEV_RESULT_DISCONNECTED: /* * In the AUTHENTICATION_FAILED and ASSOCIATION_FAILED * cases there's nothing to disconnect. In the diff --git a/src/station.c b/src/station.c index 3ead4326..01f6b78e 100644 --- a/src/station.c +++ b/src/station.c @@ -3319,6 +3319,7 @@ static void station_connect_cb(struct netdev *netdev, enum netdev_result result, blacklist_remove_bss(station->connected_bss->addr); station_connect_ok(station); return; + case NETDEV_RESULT_DISCONNECTED: case NETDEV_RESULT_HANDSHAKE_FAILED: /* reason code in this case */ if (station_retry_with_reason(station, l_get_u16(event_data))) From patchwork Thu Jul 18 11:45:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736414 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (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 6353712FB0A for ; Thu, 18 Jul 2024 11:45:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303124; cv=none; b=jmso8dhsopJtYtRHZDoUctW7BeWgEIcLBNceh4BYOGomE4GI/0I3I07DmC4HgbCbYH/n41GhwOGuYh007NcwGsnHGaVk2NMdQ6cCawqHBIy4zhgj/TbG8D3eMJSkAwiaS4meUPDvqC5iMJot57JvSH83v0Z1nuUClL8MISO5Hhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303124; c=relaxed/simple; bh=iMPkAiEo25I69eG4u/rLo85e8CEgQv2IiZZ7692nOCg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ObmspbRE8J7Q6sRYgazCL4+R6jPszqgSe2ZeCTkK8YJROHIuBdC5x8f4q2vIy1CGH2+Lu9rW6a/Fha+ZPvZmLyY7P8ldtgcDDgm4+aU/iWDMiCpGKCmAprTec7u/RmJ1v2WMb0BKUOj/vPng3vUuVilDRGFZkd9B4xoHGMUdw5k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k/4nLlpA; arc=none smtp.client-ip=209.85.219.41 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="k/4nLlpA" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-6b7a4668f1fso979306d6.3 for ; Thu, 18 Jul 2024 04:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303122; x=1721907922; 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=w9KMScYpkyjctODl9YwsDQ03Qmx2HdjozWuFMEfE4fw=; b=k/4nLlpAz7Fp4TSaJXRQwcSFRzSLdMXX0VYuQ/DbXTqHhp/Z9k9mr2z9WhLDRcTR+g OTxDL426fsyGqw/mz63iQ/zZ/S297xALwe/XVd0inA8esntVsJdJuHtt43Yr7kdBttrm 6+3SZ0MOQkvxyUVRo7TG/JvrKebVFvkQzvts+rkIYkvbH//FzTrHawNxvGDabUZYLdGK oRPifmRfuX90ehIop9RgiMVq6nFsTWkR1oWqyYUf6wXKQZUlURTdxiTnrsZJ8nl9uviY dfUMR3G1ByTWKGzPup2EMJs+F/WUWnaUzTdiRLeI29TxygrtXBS3hMhjMLHPgW812f3d cvIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303122; x=1721907922; 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=w9KMScYpkyjctODl9YwsDQ03Qmx2HdjozWuFMEfE4fw=; b=R29qxFZyjzc1sdYf8kdODZyV0RNzxwqatpkWnxVWQNRvZGz7g4qKlJzGjVKRYFATyy HXLhoEyY7RVayYKH8+BIvK+GGUqAndAsXVFLSLGGBjc7oKntLdABtJQOM0MX9nddfGTi lPagKsRpPaypR7Z8ljflSHdXXYJsqPgU1j9f6LkQ7Pp4z4uK28PMYRZ/VWPtNg6B92OR bKXiz3xAF8HcScDKwzXw35ffONppCrHs/D/OX+j0QLd2aMgEe8l6anbNEEyK/XwqwSvy oVcwzf8A2CG9KsK2Fc2ilRgm6/+BDBirTKyS3n25PWQSKO3qtAkZAQFf2q9eoRKqanhe 1Yjw== X-Gm-Message-State: AOJu0Yw45+lJMflcNn7mkGtt68tzZAIq0nmpA0h5Ulz7ZA+8PQ5frQso ZWQng6Uh0B2PGYld492KlU1DG/tOGfJYb1rzrGMAK58WKZw32uZIFMwXBA== X-Google-Smtp-Source: AGHT+IGnD5XoCw8/Yp8PRefPAHYqV5yGDigCL+0YbKtDriJfUYFQK83iLJ9fZtNHAx36UY8QQJhD3Q== X-Received: by 2002:ad4:5c8f:0:b0:6b5:dcd9:1cb5 with SMTP id 6a1803df08f44-6b78e2b409emr58065566d6.56.1721303122070; Thu, 18 Jul 2024 04:45:22 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:21 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 03/11] station: handle NETDEV_RESULT_DISCONNECTED Date: Thu, 18 Jul 2024 04:45:06 -0700 Message-Id: <20240718114514.2916258-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This new event is sent during a connection if netdev recieves a disconnect event. This patch cleans up station to handle this case and leave the existing NETDEV_EVENT_DISCONNECTED_BY_{AP,SME} handling only for CONNECTED, NETCONFIG, and FW_ROAMING states. --- src/station.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/station.c b/src/station.c index 01f6b78e..abbfc3dd 100644 --- a/src/station.c +++ b/src/station.c @@ -3311,6 +3311,7 @@ static void station_connect_cb(struct netdev *netdev, enum netdev_result result, { struct station *station = user_data; bool continue_autoconnect; + uint16_t reason = MMPDU_REASON_CODE_UNSPECIFIED; l_debug("%u, result: %d", netdev_get_ifindex(station->netdev), result); @@ -3320,9 +3321,22 @@ static void station_connect_cb(struct netdev *netdev, enum netdev_result result, station_connect_ok(station); return; case NETDEV_RESULT_DISCONNECTED: + reason = l_get_u16(event_data); + + iwd_notice(IWD_NOTICE_DISCONNECT_INFO, "reason: %u", reason); + + /* Disconnected while connecting */ + network_blacklist_add(station->connected_network, + station->connected_bss); + if (station_try_next_bss(station)) + return; + + break; case NETDEV_RESULT_HANDSHAKE_FAILED: + reason = l_get_u16(event_data); + /* reason code in this case */ - if (station_retry_with_reason(station, l_get_u16(event_data))) + if (station_retry_with_reason(station, reason)) return; break; @@ -3383,17 +3397,12 @@ static void station_disconnect_event(struct station *station, void *event_data) /* * If we're connecting, AP deauthenticated us, most likely because * we provided the wrong password or otherwise failed authentication - * during the handshaking phase. Treat this as a connection failure + * during the handshaking phase. Connection failures should be handled + * within station_connect_cb/station_reassociate_cb apart from netconfig + * and FW roams. */ switch (station->state) { - case STATION_STATE_CONNECTING: - case STATION_STATE_CONNECTING_AUTO: - station_connect_cb(station->netdev, - NETDEV_RESULT_HANDSHAKE_FAILED, - event_data, station); - return; case STATION_STATE_CONNECTED: - case STATION_STATE_FT_ROAMING: case STATION_STATE_FW_ROAMING: case STATION_STATE_NETCONFIG: iwd_notice(IWD_NOTICE_DISCONNECT_INFO, "reason: %u", From patchwork Thu Jul 18 11:45:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736415 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 8D0AD13212D for ; Thu, 18 Jul 2024 11:45:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303126; cv=none; b=qs5xCJcIt0Qsf9dFe+GSe6w6WNSlgNPA74iAQnCZ3vgtK6Je+AZSoBflyoisv0S/ZMcwtVXcocs7QOeWJpyIjEYq4vCQOKRSG8Bd+rtq6kgWiujfnBE08lc7FU7yYYq1ORhEcfOLWhplTzJhomhfa6VhrrlCg/RICH6tI3E6krI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303126; c=relaxed/simple; bh=uxyi1LybGNHO7jQgU8Nek9BiwsBMQOdVAAFWWa8RhEI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QYIcQYa6dcEMvoW7erKFObzc13/BXdX/H51Bja3tE6RmuVf2RrJZsHsAPFASWcysArNQnU9tR/oBlZ+mtilJTVZARXph39VEM5qLTCx/3dmAnEvmuoOSjD4tZV7uG2hFTgJvlDwB0Cp8rGWlRhYiX7WW4sS0ksWU5wzRF5ucfd4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=L1K0CZKO; arc=none smtp.client-ip=209.85.219.48 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="L1K0CZKO" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6b78c3670d0so4266946d6.1 for ; Thu, 18 Jul 2024 04:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303123; x=1721907923; 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=k5P6LbPCO10338QjJWBDL6Cm++KD9oA/T0WxmZtO828=; b=L1K0CZKOIO6TGCeuWPjl9yHjlO0+GGNW2j99O/hDIAOgtg//mOI65sq0M3BxFsI7sw hYK47U3Ax3FSKKzAzCoLcZ2s71XXLN6fyTKmb1OZ8WBGjpokK65+jRBKub9UtTjjX2hv aWOtOYbW6VJ97v8ItIdC/cJrwJ3unnsQ+eqAVjGUAvzbwaBqnM98BsUhJj1XaSyasxdH SVOASxfoLVOz5kH7QlH/lP31RnzZ5TsURRzEJYlhQOoiK4DKUyh2pNN7CnVvhAeJTN7H vGPWNf2TSpnXg3BKgWzMvi/yTh0OdhvTl/Oc10dIAfGe7pL2jpECGazFHPh5InCjpHNI oOSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303123; x=1721907923; 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=k5P6LbPCO10338QjJWBDL6Cm++KD9oA/T0WxmZtO828=; b=wu9zI/LKPF09EBnY9HFWF4zFdO9cWpD7RQ7ASg3VobjAOAF7QRhxc2faYUM7W86Mtu Frsbhe+6HUNBwlN1vWJ8X8LapHHeWFPkGuCHdpaQzfXPlNtsx/PjuOrcjaCkmykUENAX +1oqG7vbWXcGcQFdYXwTJ+W6yw8DRPe9hQX23E+mCCwzOqfYnPhlJOp7Fj5ke/J5eeXK l8p8lvhGs1uZ8GmnoXk6iBPcFkY0WRN2PAmMMBom2S+bEhq2wJn8QfvWC8aesuayV+Vu Gl+nE5qPgtaSMbW1Eyxvy7aps7Y3PYedz93YumwV7qLfIAbcZmLc1pxsJJVng70xArAA KuUg== X-Gm-Message-State: AOJu0Yx3SiCfoJtXt0m1BgMP+HlwFYBfBHbIQiFLnhWxSzWGbP+lhrEw GXsv0jT6K46XOqsX5sDcZWG9GXtRCqBZcXLnXqw2QOD6YJ/xMcw8s/8wsA== X-Google-Smtp-Source: AGHT+IGNeeGEBOgfEbBSGQyE73628CyO7AkdyAUhA1mrXQCOgzLFx5wYjqJX/tU9L+6bHKmHDubqLA== X-Received: by 2002:a05:6214:19c3:b0:6b5:e24b:bb0a with SMTP id 6a1803df08f44-6b78e38ae18mr60877316d6.58.1721303123145; Thu, 18 Jul 2024 04:45:23 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:22 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 04/11] station: update logic for handshake failure Date: Thu, 18 Jul 2024 04:45:07 -0700 Message-Id: <20240718114514.2916258-5-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 After adding the NETDEV_RESULT_DISCONNECTED enum, handshake failures initiated by the AP come in via this result so the existing logic to call network_connect_failed() was broken. We could still get a handshake failure generated internally, so that has been preserved (via NETDEV_RESULT_HANDSHAKE_FAILED) but a check for a 4-way handshake timeout reason code was also added. --- src/station.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/station.c b/src/station.c index abbfc3dd..62b05c35 100644 --- a/src/station.c +++ b/src/station.c @@ -3368,7 +3368,13 @@ static void station_connect_cb(struct netdev *netdev, enum netdev_result result, continue_autoconnect = station->state == STATION_STATE_CONNECTING_AUTO; if (station->state == STATION_STATE_CONNECTING) { - bool during_eapol = result == NETDEV_RESULT_HANDSHAKE_FAILED; + /* + * Either a handshake failure (generated internally) or a 4-way + * handshake timeout should trigger the PSK to be asked for + * again. Set during_eapol accordingly. + */ + bool during_eapol = result == NETDEV_RESULT_HANDSHAKE_FAILED || + reason == MMPDU_REASON_CODE_4WAY_HANDSHAKE_TIMEOUT; network_connect_failed(station->connected_network, during_eapol); } From patchwork Thu Jul 18 11:45:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736416 Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.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 84CF212FB0A for ; Thu, 18 Jul 2024 11:45:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303127; cv=none; b=GTIpCHKm8SxnWLhJXItchR+17nKoYjB0+GqjO1Fv4/+bDTkNxQOPWguJUY5jqJNetSxBZiOUtGDzRaBDzSkagPUP6JzjcRIad7w8lJtvx9F5xN3nTcGu4fnIfqvTdX8YWcqlwoBtNJO5y+PdMhf+Y+A5GSnP4lcU9vs69+hm2j0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303127; c=relaxed/simple; bh=SlFNNFuF6eChmtPDA34jZcaRxqUKmN1ZUmJrp4u0G4c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D+I+UvdZfvnhoOblZHKBGIDKLpazb/a9HP3w1RkQhejdYbhOOFQYtQqB+eTXjuFNqc+EOkjZtPeNBfmc2ov7rETO2ziMDFJiz06chKpqQpP9TVNzxEIUQEnhxmOsmfMqRpbrVZAnDSXI0d5ZStmYD8Qn3+iyNtdKGwOgtv3aNks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FqxTn1Qq; arc=none smtp.client-ip=209.85.219.180 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="FqxTn1Qq" Received: by mail-yb1-f180.google.com with SMTP id 3f1490d57ef6-e026a2238d8so741720276.0 for ; Thu, 18 Jul 2024 04:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303124; x=1721907924; 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=8sx3fRRnExPI828g4V9j8aSQ8ixzMKUs5b6fnOjrfq0=; b=FqxTn1QqO0YGAkhlDIz4hnXxXJKQdDA2K2Fd34oRdSb9bo9ZTlAup359BKoexfZlgQ pV864LvCQM1tQ3FNpmaueP49KW6zuf+iXEB6iyCDnLlFOnDIczb4F9tZSiwYa3/PRGgA X8s7UNUuq+15ibJG41b50ckYYz7rasUNRXt/LwNatCgQnmA/adAakL/xCVpLdNq703Dz fZ2cDjcRxgUyIxYxjc2JPtH+cCdNVmWNQqokfSCpj5cMdstW/ZvKYNasCRPNwkrnXMpP 536ZMn68dwRNskfPOZVqkxpLn6UFZRGW0SVTjZCVjdurMh3JadceKbEX49ur8ezz6F7r xCSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303124; x=1721907924; 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=8sx3fRRnExPI828g4V9j8aSQ8ixzMKUs5b6fnOjrfq0=; b=XUbJBWwDcNLZh3vnCr2frJX7zRGCVTCZfTEaLliLe+zWe3b8bF69oQis9jYiK7sHfy K7uqtNlZkBz+XSGd9px0QEmnhRy3G2KSlkJcNYjpjg3LOsK6adqQnCtXujmqdKdMJT8l uIjKFt/SmuUNZ5Rw231X3NUnq85du9BXFIqcQI0JdvJO6uvk83oXpPbLkhO42TiRVmUg 0x79SWMG2yUkH4Hdo3Q3eGAljsyYZV1N3YHlKyFhuQZNJFECM4Z04wHXl6r0y7/kF1kv +B62atJ6r6rJxZ3gfimnxUh6CKGDgH+HBQeuZ7gVh5tjHKoq6Ie6/K/dO9j0SGPpkYJX XwJA== X-Gm-Message-State: AOJu0YyjOJMUbF2qbI2U6k5+ZFlO7QZTAsJWypNjGq739Xxn8df92r0T YVImYAMRPS6gKoUYkfaBPPk4JLDvSoeYOUnAR7kpO3wB8ibMdgnJ+Doq8g== X-Google-Smtp-Source: AGHT+IGkfGZifAiJPCRqYkBvPhOq4NYnRWnPy4nQ7FnROeyxVrszjyA2MrkFeV4w0kugcOIeKq2Hxg== X-Received: by 2002:a05:6902:124a:b0:e08:551c:9305 with SMTP id 3f1490d57ef6-e08551c9789mr877443276.47.1721303124213; Thu, 18 Jul 2024 04:45:24 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:23 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 05/11] netdev: handle disconnect event during a connection Date: Thu, 18 Jul 2024 04:45:08 -0700 Message-Id: <20240718114514.2916258-6-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If a disconnect arrives at any point during the 4-way handshake or key setting this would result in netdev sending a disconnect event to station. If this is a reassociation this case is unhandled in station and causes a hang as it expects any connection failure to be handled via the reassociation callback, not a random disconnect event. To handle this case we can utilize netdev_disconnected() along with the new NETDEV_RESULT_DISCONNECTED result to ensure the connect callback gets called if it exists (indicating a pending connection) Below are logs showing the "Unexpected disconnect event" which prevents IWD from cleaning up its state and ultimately results in a hang: Jul 16 18:16:13: src/station.c:station_transition_reassociate() Jul 16 18:16:13: event: state, old: connected, new: roaming Jul 16 18:16:13: src/wiphy.c:wiphy_radio_work_done() Work item 65 done Jul 16 18:16:13: src/wiphy.c:wiphy_radio_work_next() Starting work item 66 Jul 16 18:16:13: src/netdev.c:netdev_mlme_notify() MLME notification Del Station(20) Jul 16 18:16:13: src/netdev.c:netdev_link_notify() event 16 on ifindex 6 Jul 16 18:16:13: src/netdev.c:netdev_mlme_notify() MLME notification Deauthenticate(39) Jul 16 18:16:13: src/netdev.c:netdev_deauthenticate_event() Jul 16 18:16:13: src/netdev.c:netdev_mlme_notify() MLME notification New Station(19) Jul 16 18:16:13: src/station.c:station_netdev_event() Associating Jul 16 18:16:13: src/netdev.c:netdev_mlme_notify() MLME notification Authenticate(37) Jul 16 18:16:13: src/netdev.c:netdev_authenticate_event() Jul 16 18:16:13: src/netdev.c:netdev_mlme_notify() MLME notification Associate(38) Jul 16 18:16:13: src/netdev.c:netdev_associate_event() Jul 16 18:16:13: src/netdev.c:netdev_link_notify() event 16 on ifindex 6 Jul 16 18:16:13: src/netdev.c:netdev_mlme_notify() MLME notification Connect(46) Jul 16 18:16:13: src/netdev.c:netdev_connect_event() Jul 16 18:16:13: src/netdev.c:netdev_connect_event() aborting and ignore_connect_event not set, proceed Jul 16 18:16:13: src/netdev.c:netdev_connect_event() expect_connect_failure not set, proceed Jul 16 18:16:13: src/netdev.c:parse_request_ies() Jul 16 18:16:13: src/netdev.c:netdev_connect_event() Request / Response IEs parsed Jul 16 18:16:13: src/netdev.c:netdev_get_oci() Jul 16 18:16:13: src/netdev.c:netdev_link_notify() event 16 on ifindex 6 Jul 16 18:16:13: src/netdev.c:netdev_link_notify() event 16 on ifindex 6 Jul 16 18:16:13: src/netdev.c:netdev_link_notify() event 16 on ifindex 6 Jul 16 18:16:13: src/netdev.c:netdev_get_oci_cb() Obtained OCI: freq: 5220, width: 3, center1: 5210, center2: 0 Jul 16 18:16:13: src/eapol.c:eapol_start() Jul 16 18:16:13: src/netdev.c:netdev_unicast_notify() Unicast notification Control Port Frame(129) Jul 16 18:16:13: src/netdev.c:netdev_control_port_frame_event() Jul 16 18:16:13: src/eapol.c:eapol_handle_ptk_1_of_4() ifindex=6 Jul 16 18:16:13: src/netdev.c:netdev_mlme_notify() MLME notification Control Port TX Status(139) Jul 16 18:16:14: src/netdev.c:netdev_mlme_notify() MLME notification Notify CQM(64) Jul 16 18:16:14: src/netdev.c:netdev_cqm_event() Signal change event (above=1 signal=-60) Jul 16 18:16:17: src/netdev.c:netdev_link_notify() event 16 on ifindex 6 Jul 16 18:16:17: src/netdev.c:netdev_mlme_notify() MLME notification Del Station(20) Jul 16 18:16:17: src/netdev.c:netdev_mlme_notify() MLME notification Deauthenticate(39) Jul 16 18:16:17: src/netdev.c:netdev_deauthenticate_event() Jul 16 18:16:17: src/netdev.c:netdev_mlme_notify() MLME notification Disconnect(48) Jul 16 18:16:17: src/netdev.c:netdev_disconnect_event() Jul 16 18:16:17: Received Deauthentication event, reason: 15, from_ap: true Jul 16 18:16:17: src/wiphy.c:wiphy_radio_work_done() Work item 66 done Jul 16 18:16:17: src/station.c:station_disconnect_event() 6 Jul 16 18:16:17: Unexpected disconnect event Jul 16 18:16:17: src/netdev.c:netdev_link_notify() event 16 on ifindex 6 Jul 16 18:16:17: src/wiphy.c:wiphy_reg_notify() Notification of command Reg Change(36) Jul 16 18:16:17: src/wiphy.c:wiphy_update_reg_domain() New reg domain country code for (global) is XX --- src/netdev.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index 153001ab..2d70fc38 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1243,8 +1243,7 @@ static void netdev_disconnect_event(struct l_genl_msg *msg, const void *data; uint16_t reason_code = 0; bool disconnect_by_ap = false; - netdev_event_func_t event_filter; - void *event_data; + enum netdev_event event; l_debug(""); @@ -1282,19 +1281,11 @@ static void netdev_disconnect_event(struct l_genl_msg *msg, l_info("Received Deauthentication event, reason: %hu, from_ap: %s", reason_code, disconnect_by_ap ? "true" : "false"); - event_filter = netdev->event_filter; - event_data = netdev->user_data; - netdev_connect_free(netdev); + event = disconnect_by_ap ? NETDEV_EVENT_DISCONNECT_BY_AP : + NETDEV_EVENT_DISCONNECT_BY_SME; - if (!event_filter) - return; - - if (disconnect_by_ap) - event_filter(netdev, NETDEV_EVENT_DISCONNECT_BY_AP, - &reason_code, event_data); - else - event_filter(netdev, NETDEV_EVENT_DISCONNECT_BY_SME, - &reason_code, event_data); + netdev_disconnected(netdev, NETDEV_RESULT_DISCONNECTED, + event, reason_code); } static void netdev_cmd_disconnect_cb(struct l_genl_msg *msg, void *user_data) From patchwork Thu Jul 18 11:45:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736417 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 B1AD712FB0A for ; Thu, 18 Jul 2024 11:45:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303129; cv=none; b=uf+xgISZw16ycy5CwWLsJlpFuGJEio4en4k8evt6QJOu5cQS6jzsvO8nK2Xy+vqGLgJGyIiUoQZWRh33nUcE/m434vFEME1lngJctsn45kJI6EtRBjiET1yG7xpCN0Gm2a9t2lUOqMCI6tyG2/jWLhr5evxf7Y9KwP3f4QuTnfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303129; c=relaxed/simple; bh=wZ+kNudVV7hwu4gCZ4CWnYsGgwx3Egdac3AVoFktwuU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=k5Egj2IiBRNEOv6zQT2qvH9QANedjx7yXgDSAOci7RF6nM1qNN+pl+2tXqTvDDpKEkrj1wbLQi89VDoI2oBCHJbpHspd967voBTkpGBzM8KoPfO0082a4QSN8T2S3W9tc8OlGAljE+1TOsVoPuVi1HW6RQ1JS+MnWZXSkj4YJvo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VTELeszq; arc=none smtp.client-ip=209.85.222.169 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="VTELeszq" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-7a05b7c8e38so11089685a.0 for ; Thu, 18 Jul 2024 04:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303125; x=1721907925; 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=7MToUH3sxHOEmHeBTXUaH2EP9mBA1Q5dI65ZttqNNPQ=; b=VTELeszq29EFucsILB9FO3BongR/qoXkIecxjo4W3JJ4ctTjjoUCu/1hYw7Thv5Y9k b4I+DYd5qskQ4XL78xBe+6EbyjZCk5yFgJ0sjCXGwcK3w//SUu5UgXdbxEuiPquMCE3I zKrnWz87MLPZ8Xl/5ltedtePJOCJd2ilG6eNcJLy1WndB/vVeXGM9R0QyHxP1eJvaMDU Lj+2PIIBbmUJqgwN80JgJs1eZvGsarQlzWV+0+dksduilJRUK5NKAhozUI1kBVKANbCU BwzthQKNTN5+yuoiSc+7/aK+Ek277/NcpPuDetHdYEjM/EEB9qAWj5jG/zNrbTvTHcpf PVlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303125; x=1721907925; 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=7MToUH3sxHOEmHeBTXUaH2EP9mBA1Q5dI65ZttqNNPQ=; b=H5ajABSjj2p9xmGywtWE2YgUXFj04KyMf5GnBww0fWFUoH2E36F2vMfwHWdVYCX1nX xetJsnxn27dNviLvRJttM+tG2UPTkDARrRLUvhDmBgKoYV4WV62w197vjwMu00kGqtVd XzDhp/cCebBZFjkxMwg5fX2C7lyBT3OcqSWZqccO83W7VJEnSbmEUKC0PQR/srUsgO6W YJBqIiwLx7bIzAgnC+gdQsn6vGMg/V10ArvYzLrwNIhCvS4NoERKmpyWa67g/u+0htT2 xBIgguwgmMu1eOqRsg92aQE8v5eWXuVT+x9OF5mdlmmdHfkFOfGRwf0fh4YssFpGEAMf MKVQ== X-Gm-Message-State: AOJu0YxwZUODvb68FRcy2XVkoeEBxZo6PXM4WArxZh/OZo9oMPytZEs4 Dbb1ARLhXxbT5SD86un2z0DRhvuUW/Fy2+WST94jEQtpdOkFxIyrrpSH6Q== X-Google-Smtp-Source: AGHT+IFDVeXohlxtYEVQ2KAAugUwHNKzlaiDBfil1d6MvVGh6OmvnotonbjGR7vov/ZkKPvCxndtGg== X-Received: by 2002:a05:6214:2307:b0:6b5:116:eb54 with SMTP id 6a1803df08f44-6b78e2ad032mr43520066d6.47.1721303125380; Thu, 18 Jul 2024 04:45:25 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:25 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 06/11] eapol: move HANDSHAKE_STARTED_EVENT to eapol_start() Date: Thu, 18 Jul 2024 04:45:09 -0700 Message-Id: <20240718114514.2916258-7-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This even is not used anywhere and can be leveraged in autotesting. Move the event to eapol_start() so it gets called unconditionally when the 4-way handshake is started. --- src/eapol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eapol.c b/src/eapol.c index 845ef866..6d176304 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -1036,8 +1036,6 @@ static void __send_eapol_start(struct eapol_sm *sm, bool noencrypt) uint8_t buf[sizeof(struct eapol_frame)]; struct eapol_frame *frame = (struct eapol_frame *) buf; - handshake_event(sm->handshake, HANDSHAKE_EVENT_STARTED); - frame->header.protocol_version = EAPOL_PROTOCOL_VERSION_2001; frame->header.packet_type = 1; l_put_be16(0, &frame->header.packet_len); @@ -2858,6 +2856,8 @@ bool eapol_start(struct eapol_sm *sm) eap_set_peer_id(sm->eap, network_id); } + handshake_event(sm->handshake, HANDSHAKE_EVENT_STARTED); + sm->started = true; if (sm->require_handshake) From patchwork Thu Jul 18 11:45:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736418 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (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 B695F13A87E for ; Thu, 18 Jul 2024 11:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303129; cv=none; b=Vx+7TSIII1J4Q5qrUyzd4XPBZtaqeoF5/d7VpxTU2PBzGmAeE6+KoeyMUEl5DZGrUk0EU1hpehyJNsa93+TEIyUxwTP0pFVY0UZ4iLComurcCk6F1i8RiE6+9X0dQXwUrUgDPAcMTF5Bd4Ga9/X67aGWOQHXIzgn3EhW5rc+aUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303129; c=relaxed/simple; bh=mzX37m6OwHWnkSgdkOmcYRlQPz9kWsaW8faDpeKPdTk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TY6n2wKtqiRCC+crDKs2lBOEr3s173zay5dkkoq1DY4jw++TO6Skbv5cluRTkAiRxchGqNZM1nCY6hU6D8SZLPouFiGSM+PdAf3DzGDK4CPzcpzc5fl4gehUs1UrKp4SiURvdYvMcTyQ+uLJlrpzTrNqhLR1ZwNfvePmwETh12o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PVeRAU1a; arc=none smtp.client-ip=209.85.219.44 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="PVeRAU1a" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6b760dc7e08so4927296d6.3 for ; Thu, 18 Jul 2024 04:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303126; x=1721907926; 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=hJu/qFP10T4RXl8ll9a0J6IDXFcKvBXWY5vbx00wIVI=; b=PVeRAU1adS2WrCAjJjNS+Jv4QrQnFPLn7huegCWXIOLcEMjf7gJodaW4T3WRJ1NwIC yoX+XqBIMzU6992UfaCOENtgVxEPGFas8qIBstU5JI4y101h3p8GWxkGXsE2Spp2sBGg 8wPbW9BbLX6ujnduOw6TD49MrZhhdFcQ4IdLBjXZmMASBdktTctp6EZlJuMiA+jke4xH EuozVU6z46GCS1HZadOmsB2OIvUwvCFUHaKQWwwvRQDe8w4V7eTVZpdj7OjL+APU/F50 3nSDgF/wu0uWXIn12acqdjfWzUVyuf/RugIlyeX6331QrvxEiOyCE0a/ybYEQBrv5kFx 7UkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303126; x=1721907926; 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=hJu/qFP10T4RXl8ll9a0J6IDXFcKvBXWY5vbx00wIVI=; b=hmEGf40QUIkfjgrHhQwnxbIjl4/y3NCKn1vKkWRumWFDUaBV+uGdgMUaFHFzsuS03Q 3mpZWyWU9wc1PfPAtNK39qihXvDYjOxHt4wJTINpnWDskHJybeiSRw/GOzxAwVMcjCNi qMomx96T56yeqI3ZpG6RWIpLl0J2/NV/jzRRthR9CKD7PXH24DBQdiBedLX1ZFDY5foA oDO81fuvgIat4TD7zHz2SaLsrWr+XnEjLDANbPo+clydq3YQVMCBMVbogcgbYlkpdVme KAh7+lU9SuRp2myOZ63ePzVeBP8pvdQAf2t+Hdl2KsUyZA4D5ftAgR9fGVj0HyrpSr2x Tm2Q== X-Gm-Message-State: AOJu0YzoA15ZiiPkEng6/NRUie1E6sSJBIWijPwW6LcICaFaXSF35Lq+ LFLTRI0ZaBCHv/GTTl3umqu1UDFUBjbZbtpmyt1EtwWzuZIQ+nNWT+gTrA== X-Google-Smtp-Source: AGHT+IH6LJ15FZD9c9PBNtqTcQfbwLfHJv+PhnTStWy6WLNaHLWXhIeh/R+QB3CqJIYBL65NdWMifQ== X-Received: by 2002:a05:6214:2349:b0:6b1:e371:99d3 with SMTP id 6a1803df08f44-6b78c8deb22mr59514356d6.0.1721303126444; Thu, 18 Jul 2024 04:45:26 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:26 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 07/11] station: add handshake-started debug event Date: Thu, 18 Jul 2024 04:45:10 -0700 Message-Id: <20240718114514.2916258-8-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/station.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/station.c b/src/station.c index 62b05c35..ca0e6a38 100644 --- a/src/station.c +++ b/src/station.c @@ -1015,6 +1015,7 @@ static void station_handshake_event(struct handshake_state *hs, switch (event) { case HANDSHAKE_EVENT_STARTED: l_debug("Handshaking"); + station_debug_event(station, "handshake-started"); break; case HANDSHAKE_EVENT_SETTING_KEYS: l_debug("Setting keys"); From patchwork Thu Jul 18 11:45:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736419 Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (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 94DFB13212D for ; Thu, 18 Jul 2024 11:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303130; cv=none; b=FWmUwLE7E/szvDB9CjvlvDzaRwIf9nPZ7jUCpxJIlP03q0u+WSDnAzHtLKhWuWkpsDsWpi7UVHfUGBhFsMmhaoz0QT2iAtji1EsLz3fX5YdaA/5dD6YSKLBjIRIWqLsDtRx/mShKqogS/LTJJP/pWS5lXca9jgF1xrBTm3BgPQQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303130; c=relaxed/simple; bh=BeueZWDXixymJFyPRdsGIekPtFW//6cluBuzP7j4x9k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qHECGEjQpaSC2XI36xPBvDyRxDR+YFmyFhyC2/1RpUj/D1iQJV1fpL8+yL/fZGZrnQps/qfoekRSaJU6ldLu82IBVYzO1g1eTkhEamD0VvhQ9uMwcQ6VFXwVh73O8N/L6b5U/qzZJ5+AJGeV3dFOozH1TT4g1m3ozRjVNQYaMDY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YtPq02o5; arc=none smtp.client-ip=209.85.219.170 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="YtPq02o5" Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-e03d49ff259so722105276.2 for ; Thu, 18 Jul 2024 04:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303127; x=1721907927; 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=N1iztXrJVzy+bdpMpzcoTbj2hxX9w4+Z1fDvnyjiApo=; b=YtPq02o5OOO1UzyxpXzt7PmDHA8xjLW3MSGUs+byMpbrIWdIoGizwb21pT8/tq8HJ6 jItHM3woRF1z/dHTlnPIIVX2nTQwATikaAfmtjP/uvr+7qIWwvdEsHtQmrqMPlnycqeS uDUZlxipyF46yYDQ8FFFFfEnQBg3jWE4eh8wONpiLZT5ixhxo4lwoijQTDr4V6jKCAV8 jkz8Sg1UwRgv6wvpRai4z2ho/GCqU/8haMslj0ifrmTqpVBlOIW1Vxw2lPGSFj0VgdvJ lmI8mS+pu7TVYvTUaD9ulhHOVolUqjOovV2RewPxvu5VdrjSckd0r3AMplLp9Zlqf9NI auCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303127; x=1721907927; 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=N1iztXrJVzy+bdpMpzcoTbj2hxX9w4+Z1fDvnyjiApo=; b=f4ekNmT1UXqFr/s1H1wNNIMD5AymXB6U9Zr0a644nvxgrQuWXwL+eaok2DKq3n2A8w Qt6EpXznjuAtvqPm6oRRmY/X7RuCw/LRNGHCB5NuMiN5oUiYyaC0PaIDuzXpoY9GAETo WMFc4D6mkBx0jo2my/74V8uyp5SOg8SKws01gY61sXW7dYtzLcB3fPDwXJWmwgaE9osz BqdDkQ5uzoITLq9FuJkCulYpGH7qaB4o07ynvXIxf8/vFFaErkXY8knay7o8k0zf/iSq NtPXYBGo2nMZ5cCtr04td8gp232E38lenWwtqdlGFzniVAiB72e4jssVYDFrKZuGw7ch jb7w== X-Gm-Message-State: AOJu0YzWnuW6xOuZ2Y3Rof0mnqgZvfDKfNkIpbUDExb4Em1cVnRFWOr4 7M1R6EFdOvAleWYPPYWUvA9RPoQHJvaTIzfV6LUPnwlFq2r4nu2LMDeAbQ== X-Google-Smtp-Source: AGHT+IF9b2ijeVWSv0cGusgVX9ViqERuADtuOXHjQYL2Kok75qDBON3dCxkF7nh2PR/60BmGv9CFtQ== X-Received: by 2002:a05:6902:2086:b0:e03:a688:ab5e with SMTP id 3f1490d57ef6-e0640dbe8fdmr2054326276.27.1721303127464; Thu, 18 Jul 2024 04:45:27 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:27 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 08/11] auto-t: add clear_events() to IWD class Date: Thu, 18 Jul 2024 04:45:11 -0700 Message-Id: <20240718114514.2916258-9-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The wait_for_event() function allows past events to cause this function to return immediately. This behavior is known, and relied on for some tests. But in some cases you want to only handle _new_ events, so we need a way to clear out prior events. --- autotests/util/iwd.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 511fb3a5..1d4a5472 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -299,6 +299,9 @@ class StationDebug(IWDDBusAbstract): return False + def clear_events(self): + self._events = [] + def wait_for_event(self, event, timeout=10): return ctx.non_block_wait(self._poll_event, timeout, event, exception=TimeoutError("waiting for event")) @@ -859,6 +862,9 @@ class Device(IWDDBusAbstract): def wait_for_event(self, event, timeout=10): self._station_debug.wait_for_event(event, timeout) + def clear_events(self): + self._station_debug.clear_events() + def event_ocurred(self, event): return self._station_debug.event_ocurred(event) From patchwork Thu Jul 18 11:45:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736420 Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.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 CA08B12FB0A for ; Thu, 18 Jul 2024 11:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303131; cv=none; b=B7xbZNZLziO9po5ZP3yXJQnBvoVYab+SIDp+YmnNI8gUCPEAyrz+uuX8SwuFy0hI+OH0YQThQMYqEhA4mttOglJ6lxzCotqz2Ei02mcOmgbt02pRdkbjlrMh7S7CUhn+2e3MQLFIJUwp9P/yTT+qR2xLrgaRkzI13uWNtqjlZiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303131; c=relaxed/simple; bh=OlwDQKwFC/ByBRnpX0xVvs24NfSuyYAHZ+AMsdfvDmg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HV1havD1RxkPhL/NYKMsl6vMujIqLNhruVdWbXo+AiopF5r3yQvwSg1pkUp2dGTrmtbGNqv8TyQhLs0+p3UNzU1cBiYIdcfLOjSg3QScz74DzYIyB5KAx+4xPMB3T7hqrxSzvxwsEN4phLT4iTEZUcdamOfQ6K9b6YQi02gqQHk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bCA8O9Xi; arc=none smtp.client-ip=209.85.221.178 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="bCA8O9Xi" Received: by mail-vk1-f178.google.com with SMTP id 71dfb90a1353d-4f2e147ee98so317506e0c.0 for ; Thu, 18 Jul 2024 04:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303128; x=1721907928; 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=d//Q+wVntkq41Q+k/oiO3Y1C/TZAIgUS+B96eAH9Il4=; b=bCA8O9Xil6Npk0YUo3vETN8+K/D+0fRsW0lby+ClkryWrPXRjOAHSM8BgTwPLApsIG Wq94TKXLhmLbU7t/8cUsyke764Us1pg5lpHBUOuqF2seSxpbRZYeFL5XP2s3O7EQl7ck dsguSPIS9XcZmNenD1G/j/dKvKvmLdtpGM5kxYd2UqTEeF34K+AW0bKgFD618BENB/gT IVEZBR7pouvPImWzWHmvU2nwdntx/YACukkCjtpyslsv5QFW2Z71t++gtRGNcVl2D/FY zP9PL0HqHqOZvZr7v4+IDIAVM+AC8l8VUvtMxD5ap0pkTdi3esVb5MRvgf02RF8ZmtMm xqOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303128; x=1721907928; 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=d//Q+wVntkq41Q+k/oiO3Y1C/TZAIgUS+B96eAH9Il4=; b=gx+VBvv4fHcsDXvVFMSHCqqtc6vz1AzBYKbY8LMh9HGBdGV5T2kQK9w7PQftBponVa T671tP6V1LwO8nOJrQ3gCInRjqQL4XNeKcvoPcmk0yEth//cB6gMU7wODbLKrPlrVEC8 eA2z2+UtPJJcoVc1myBBR3y5lMwdGIJHP5Kxf3C5tliM0FbQwQnFvOJKPTLjFy9hxhAf BbIADXokgQNCt1H55MoZxZdiJVjcKlJqVAFqXABDeZrD+SKpTCm03Ln5lFmOqY4P7MvO SgqSfv6m1HlA3dZI+6I0ngUAPpOSvKEVYuwyYLNNkaFnJwB9OWg1CcoYmuES9cPAoG3q c8EA== X-Gm-Message-State: AOJu0YxeD29SCP8l9WDjeKGGx+q69aXuyxlVnj3dCtpBF5RabJPWqPNS TZzz1Q/iBTmHSsaDLryn7meOpsAye8gGV98N7OoWV9JSoRsocPHqFQwgdA== X-Google-Smtp-Source: AGHT+IGIeX/8GVMeRA57uF6eQuCKr+1nnx69tzWl8i3pv0MKue87apEQr6nsNmvje9ZRM38wmSqFpA== X-Received: by 2002:a05:6122:1818:b0:4ef:64a2:8e18 with SMTP id 71dfb90a1353d-4f4df89f9eemr6022569e0c.12.1721303128506; Thu, 18 Jul 2024 04:45:28 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:28 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 09/11] auto-t: add reason/test arguments to hostapd deauthenticate Date: Thu, 18 Jul 2024 04:45:12 -0700 Message-Id: <20240718114514.2916258-10-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The reason code is obvious, but the test argument is actually a toggle to send the frame encrypted or unencrypted. --- autotests/util/hostapd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py index 2f92e330..e5e35a96 100644 --- a/autotests/util/hostapd.py +++ b/autotests/util/hostapd.py @@ -184,8 +184,12 @@ class HostapdCLI(object): cmd = self.cmdline + ['wps_pin', 'any', pin] ctx.start_process(cmd).wait() - def deauthenticate(self, client_address): + def deauthenticate(self, client_address, reason=None, test=None): cmd = self.cmdline + ['deauthenticate', client_address] + + if reason: + cmd.append(f"reason={reason} test={test}") + ctx.start_process(cmd).wait() def eapol_reauth(self, client_address): From patchwork Thu Jul 18 11:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736421 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (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 DA9E613AA4D for ; Thu, 18 Jul 2024 11:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303132; cv=none; b=MCivtirp/vV/Q8bumRxtdNMhm3B4Pt6u1M7YGsiYBh1eXqdg41v44S5Lig8IMuM6//I3C02+2FLuzbqxG3Km/mDgnoYjP6S+T2GzCWyXEqMiqvTmuV5Q32Z0ZOH8ouefAw3wW1ClxcZLWTCPXPPus4BoLVsBPFY5f6FhLnhBEyI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303132; c=relaxed/simple; bh=aRFxYDwmCE7MOGSuIVN6TwwDLykzntRea7DdsZuQBdk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bu7JWV1kJCahpyV+MJvublSJVTl4x5IEaJBUcZu2VTa07iVGOt1kJiecDterNcOic2aMV9nrJSyDfuP30W94FA1D9shPSIlA+9fpmLO9qOxro1MagVmKCfiEQ2Z3gPa7+g0aLu4QkVMOJoLZKVrLU1iOJoxy/rxeZCCOCsL5Ti0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aMIuvBzF; arc=none smtp.client-ip=209.85.160.169 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="aMIuvBzF" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-447d6edc6b1so1034501cf.0 for ; Thu, 18 Jul 2024 04:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303129; x=1721907929; 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=7OhsN8zELOQglnO4wFDWd+oiNlSYExCT5xs8E7+DKXI=; b=aMIuvBzFh0HHzFFJrPfYsQf/HBFkyJQrNPUI4jpxRK2R76oDAYYMnvYjHWvS1FNReP 319m7gD82cjPXUQQv7KGtvkNp/07FxNi7A27V+phlZ/N3X5I4GUvD2013CPsElBOQPT2 5PFrQQrDNuFylCtU4+eLMOYY+02OX5BLt89o8s8NnFxiFZvmpjjKtylfxWJR3Z9tmleb YwZWswhA2P0Jd+/hGbhOWxoRYU2Sjk5pNc4WbMcLdP+Vq8yK/x6fmBEKubIR1Zt9RQCg OptVIJYmZfv67ayItkFTrpwT8YzQq2ZMKFodIDQ2ODWzDegghLwynVtjEAndlFdprMUR RTVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303129; x=1721907929; 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=7OhsN8zELOQglnO4wFDWd+oiNlSYExCT5xs8E7+DKXI=; b=AZPBm0e88GPvGlZdjIBzuAbKTDwts/t7dNLjqBnWJejv+QTN/hzRipd15WiZWNmwxV obJHF0cEiOBAXBlUrmoN86gH2qZWec/aOFA+iXLge5jfsH2mgPjecUgrAM4PUOAZ2arm juQCdWM8kTf6fbrl2bTysXVwA4BRvfr1+NvbGp5730KpGgqA6B6aVUk+3OMnM6f65H0Z thcFwSunsF950wlmThhaIwcljQ1e3YBl6F2rURGu0Nlcy7/YD9CImoAi+vsSjbx3mokv EaQHgkWsPeDHju1ib0zSpOhYELpIKkmiPBIV/kSPMzPFrP8nQf4yNTOiExkQYp98PyHc 94gA== X-Gm-Message-State: AOJu0Yx9gfAyDlUCoetWFdxsPzKqbl63cEw9nZ7eaNeeO6M29/4Dbfz5 9sGvvDBdx0NNZB4TzZCMsC4HYN7lrlssI5pt1xh9GDl7Rz5Lz2my9NnCgg== X-Google-Smtp-Source: AGHT+IHwfjYwWLjpFxqdZm83bWREVQliQGuvG6trl84I6fMCRLuKG/3IvkuyKturpufqVRRRmApwYA== X-Received: by 2002:a05:6214:2b0f:b0:6b4:fbec:952f with SMTP id 6a1803df08f44-6b78cacf392mr59364856d6.25.1721303129568; Thu, 18 Jul 2024 04:45:29 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:29 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 10/11] auto-t: Add deauth during the 4-way handshake test Date: Thu, 18 Jul 2024 04:45:13 -0700 Message-Id: <20240718114514.2916258-11-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This test will fail with current upstream as IWD hangs when the deauthenticate event arrives. Once this is fixed the test should pass. --- .../disconnect_during_handshake_test.py | 112 ++++++++++++++++++ autotests/testPSK-roam/ft-psk-ccmp-1.conf | 2 +- autotests/testPSK-roam/ft-psk-ccmp-2.conf | 2 +- autotests/testPSK-roam/ft-psk-ccmp-3.conf | 2 +- autotests/testPSK-roam/main.conf | 3 + 5 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 autotests/testPSK-roam/disconnect_during_handshake_test.py diff --git a/autotests/testPSK-roam/disconnect_during_handshake_test.py b/autotests/testPSK-roam/disconnect_during_handshake_test.py new file mode 100644 index 00000000..026081c3 --- /dev/null +++ b/autotests/testPSK-roam/disconnect_during_handshake_test.py @@ -0,0 +1,112 @@ +#! /usr/bin/python3 + +import unittest +import sys, os + +sys.path.append('../util') +import iwd +from iwd import IWD +from iwd import PSKAgent +from iwd import NetworkType +from hwsim import Hwsim +from hostapd import HostapdCLI +import testutil + +class Test(unittest.TestCase): + def validate_connection(self, wd): + device = wd.list_devices(1)[0] + + ordered_network = device.get_ordered_network('TestFT', full_scan=True) + + self.assertEqual(ordered_network.type, NetworkType.psk) + + condition = 'not obj.connected' + wd.wait_for_object_condition(ordered_network.network_object, condition) + + self.assertFalse(self.bss_hostapd[0].list_sta()) + self.assertFalse(self.bss_hostapd[1].list_sta()) + + device.connect_bssid(self.bss_hostapd[0].bssid) + + condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_condition(device, condition) + + self.bss_hostapd[0].wait_for_event('AP-STA-CONNECTED %s' % device.address) + + testutil.test_iface_operstate(device.name) + testutil.test_ifaces_connected(self.bss_hostapd[0].ifname, device.name) + self.assertRaises(Exception, testutil.test_ifaces_connected, + (self.bss_hostapd[1].ifname, device.name, True, True)) + + self.rule0.enabled = True + + device.roam(self.bss_hostapd[1].bssid) + + device.clear_events() + device.wait_for_event("handshake-started") + self.bss_hostapd[1].deauthenticate(device.address, reason=15, test=1) + + # Check that iwd is on BSS 1 once out of roaming state and doesn't + # go through 'disconnected', 'autoconnect', 'connecting' in between + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.disconnected' + wd.wait_for_object_change(device, from_condition, to_condition) + + def test_disconnect_during_handshake(self): + self.bss_hostapd[0].set_value('wpa_key_mgmt', 'WPA-PSK') + self.bss_hostapd[0].reload() + self.bss_hostapd[0].wait_for_event("AP-ENABLED") + + self.bss_hostapd[1].set_value('wpa_key_mgmt', 'WPA-PSK') + self.bss_hostapd[1].reload() + self.bss_hostapd[1].wait_for_event("AP-ENABLED") + + self.validate_connection(self.wd) + + def tearDown(self): + os.system('ip link set "' + self.bss_hostapd[0].ifname + '" down') + os.system('ip link set "' + self.bss_hostapd[1].ifname + '" down') + os.system('ip link set "' + self.bss_hostapd[0].ifname + '" up') + os.system('ip link set "' + self.bss_hostapd[1].ifname + '" up') + + for hapd in self.bss_hostapd: + hapd.default() + + self.wd.stop() + self.wd = None + + def setUp(self): + self.wd = IWD(True) + + @classmethod + def setUpClass(cls): + hwsim = Hwsim() + + IWD.copy_to_storage('TestFT.psk') + + cls.bss_hostapd = [ HostapdCLI(config='ft-psk-ccmp-1.conf'), + HostapdCLI(config='ft-psk-ccmp-2.conf') ] + + unused = HostapdCLI(config='ft-psk-ccmp-3.conf') + unused.disable() + + cls.bss_hostapd[0].set_address('12:00:00:00:00:01') + cls.bss_hostapd[1].set_address('12:00:00:00:00:02') + + rad1 = hwsim.get_radio('rad1') + + cls.rule0 = hwsim.rules.create() + cls.rule0.destination = rad1.addresses[0] + cls.rule0.prefix = '08' + cls.rule0.drop = True + + HostapdCLI.group_neighbors(*cls.bss_hostapd) + + @classmethod + def tearDownClass(cls): + IWD.clear_storage() + cls.bss_hostapd = None + cls.rule0.remove() + +if __name__ == '__main__': + unittest.main(exit=True) diff --git a/autotests/testPSK-roam/ft-psk-ccmp-1.conf b/autotests/testPSK-roam/ft-psk-ccmp-1.conf index b46d1f27..839eb496 100644 --- a/autotests/testPSK-roam/ft-psk-ccmp-1.conf +++ b/autotests/testPSK-roam/ft-psk-ccmp-1.conf @@ -13,7 +13,7 @@ wpa=2 wpa_key_mgmt=FT-PSK wpa_pairwise=CCMP wpa_passphrase=EasilyGuessedPassword -ieee80211w=1 +ieee80211w=0 rsn_preauth=1 rsn_preauth_interfaces=lo disable_pmksa_caching=0 diff --git a/autotests/testPSK-roam/ft-psk-ccmp-2.conf b/autotests/testPSK-roam/ft-psk-ccmp-2.conf index 3e215457..2ffd7262 100644 --- a/autotests/testPSK-roam/ft-psk-ccmp-2.conf +++ b/autotests/testPSK-roam/ft-psk-ccmp-2.conf @@ -13,7 +13,7 @@ wpa=2 wpa_key_mgmt=FT-PSK wpa_pairwise=CCMP wpa_passphrase=EasilyGuessedPassword -ieee80211w=1 +ieee80211w=0 rsn_preauth=1 rsn_preauth_interfaces=lo disable_pmksa_caching=0 diff --git a/autotests/testPSK-roam/ft-psk-ccmp-3.conf b/autotests/testPSK-roam/ft-psk-ccmp-3.conf index 3e215457..2ffd7262 100644 --- a/autotests/testPSK-roam/ft-psk-ccmp-3.conf +++ b/autotests/testPSK-roam/ft-psk-ccmp-3.conf @@ -13,7 +13,7 @@ wpa=2 wpa_key_mgmt=FT-PSK wpa_pairwise=CCMP wpa_passphrase=EasilyGuessedPassword -ieee80211w=1 +ieee80211w=0 rsn_preauth=1 rsn_preauth_interfaces=lo disable_pmksa_caching=0 diff --git a/autotests/testPSK-roam/main.conf b/autotests/testPSK-roam/main.conf index 3d93ff57..a6887c9c 100644 --- a/autotests/testPSK-roam/main.conf +++ b/autotests/testPSK-roam/main.conf @@ -3,3 +3,6 @@ DisableMacAddressRandomization=true [General] RoamRetryInterval=1 + +# For disconnect_during_handshake_test +ManagementFrameProtection=0 From patchwork Thu Jul 18 11:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13736422 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 D0F0F12FB0A for ; Thu, 18 Jul 2024 11:45:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303133; cv=none; b=epZWOIb3xWUQzcTsbgHkpnMGDvtTnQ6iR3t0Lh0gsWxhXoX7toEDD+jBUaIEqhxXThePdwQIZVoxe6q0dXKB9yrR/UVY2ibdOpZC6nZW3saVr1Qpf87K67bQ9/D+lEtMC1aiX8uM63HPSAaqDYgxUXbmXuTDXWWTVW+HFR00wsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721303133; c=relaxed/simple; bh=/+Z1Y+SO9AcLbBX5Oaez6kGYH77bKDDld+2HFzNqhgk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SBuW3WqGwhaTjhd3QVrm0htEpMp8h3wYmIzXQeNobe0+L5kb3kFvdLIoLA6QsCRSFP5hNUCnu18/7HjzRw0I5Si/N0NGyoSStka/+D0YI7o8OSHFLt/EuzupMcFdFODdgzQd79FWcGEQm+AMA9Dc8QouY5i9/2BVmqzA4bkMJq4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KJ+6iiw7; arc=none smtp.client-ip=209.85.222.182 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="KJ+6iiw7" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-79f15e7c89cso13829485a.1 for ; Thu, 18 Jul 2024 04:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721303130; x=1721907930; 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=Z555IW3K2UwJGIL0eaEBLlblD8EVnzQMK8WBPMH9mEs=; b=KJ+6iiw71jy0vdV1HdcyI8FawYFKQLEA1+es+I8GhSry3uMFQ+uGHO+oxXAo/Q9CYV 3IhcUhr53uHhuDXSv11fxxWDYPibjVOgxBkUGdVd4SqmrA0t6fVnr8YLoimE1AYrotvE V7FlhcimNZ3ipDyAbKTwN3Y/mNo+Iai5LBxbn0QS3EVT4D6UqFIlWD3giuypRUhfgvVV +YuiTwrg/Z9LWVGI5IbzCalYJs2WamXqXu9/Kx6MXscyfDU5m60xz2NhviBQKkZ8oguR HaPNy+o0Kx8yg9WizgME4TUAOdYA/m6yQgHh7THQr2PRPpBMGVCKBpeCldH0xwW094Jo Qxaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721303130; x=1721907930; 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=Z555IW3K2UwJGIL0eaEBLlblD8EVnzQMK8WBPMH9mEs=; b=EgsqU/2OaCvTCl7m/EMjqTFMK0fzzJaUmxj7B5z+yGEb7W2F2a4KF7t+4mragJlKva Q9nlc9uWmWhQ/uLzFNKosAmbTYkf6cLcNmillmqHAzlAn1TUAyrtRv3nVV5e8IGlzk90 1y5XX21wu6Ys7AxDy518Wzlp2QsiABo1c+5LJtpVGHkqE1cJOcSHtUCGDz2WkQOqxHft Zip1NlexwiRQO6n8NURVCVCWbfiCrsFXa4VMs5/gsutmkaP8DHhYyjodHCeSITURUD5Z FsKDAXMb5023ROjzM40xzR/TAu+iDghTWvB4z2wlOUssF4LDtqn/fpK6csEvmpqrkUKm BltQ== X-Gm-Message-State: AOJu0Yx5Bj8RfkReorVxq2YpsEXJbQhs31zl8huwggCA89KziKATtMVp X9NVCczxK8ugU2obqCnnbdK1rrFS267tnLfL3BhQkApbgpu19910zD0FkQ== X-Google-Smtp-Source: AGHT+IG7xxov325wEJKg/+uqg03RPdNozP9SiCeyOwcibSzbLhTwFApe1g3fFIUhEJbrg6+834rCwg== X-Received: by 2002:a05:6214:b65:b0:6b5:79:ff08 with SMTP id 6a1803df08f44-6b79c505428mr36186076d6.6.1721303130673; Thu, 18 Jul 2024 04:45:30 -0700 (PDT) Received: from LOCLAP699.localdomain ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b79c5138bbsm7292006d6.61.2024.07.18.04.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:45:30 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 11/11] auto-t: a few random autotest fixes Date: Thu, 18 Jul 2024 04:45:14 -0700 Message-Id: <20240718114514.2916258-12-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718114514.2916258-1-prestwoj@gmail.com> References: <20240718114514.2916258-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 testEncryptedProfiles: - This would occationally fail because the test is expecting to explicitly connect but after the first failed connection autoconnect takes over and its a race to connect. testPSK-roam: - Several rules were not being cleaned up which could cause tests afterwards to fail - The AP roam test started failing randomly because of the SNR ranking changes. It appears that with hwsim _sometimes_ the SNR is able to be determined which can effect the ranking. This test assumed the two BSS's would be the same ranking but the SNR sometimes causes this to not be true. --- autotests/testEncryptedProfiles/ssidCCMP.psk | 3 +++ autotests/testPSK-roam/failed_roam_test.py | 3 +++ autotests/testPSK-roam/roam_ap_disconnect_test.py | 12 +++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/autotests/testEncryptedProfiles/ssidCCMP.psk b/autotests/testEncryptedProfiles/ssidCCMP.psk index abafdb66..a82ae05d 100644 --- a/autotests/testEncryptedProfiles/ssidCCMP.psk +++ b/autotests/testEncryptedProfiles/ssidCCMP.psk @@ -1,2 +1,5 @@ [Security] Passphrase=secret123 + +[General] +AutoConnect=false diff --git a/autotests/testPSK-roam/failed_roam_test.py b/autotests/testPSK-roam/failed_roam_test.py index 60bcf366..e0b2f955 100644 --- a/autotests/testPSK-roam/failed_roam_test.py +++ b/autotests/testPSK-roam/failed_roam_test.py @@ -247,6 +247,9 @@ class Test(unittest.TestCase): cls.rule2.remove() cls.rule3.remove() cls.assoc_rule.remove() + cls.rule_bss0.remove() + cls.rule_bss1.remove() + cls.rule_bss2.remove() if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testPSK-roam/roam_ap_disconnect_test.py b/autotests/testPSK-roam/roam_ap_disconnect_test.py index 76c62ea0..9c660016 100644 --- a/autotests/testPSK-roam/roam_ap_disconnect_test.py +++ b/autotests/testPSK-roam/roam_ap_disconnect_test.py @@ -81,12 +81,21 @@ class Test(unittest.TestCase): cls.bss_hostapd[0].set_value('ocv', '0') cls.bss_hostapd[0].set_value('ieee80211w', '0') + rad0 = hwsim.get_radio('rad0') + rad1 = hwsim.get_radio('rad1') + cls.rule0 = hwsim.rules.create() - cls.rule0.source = 'any' + cls.rule0.source = rad0.addresses[0] cls.rule0.bidirectional = True cls.rule0.signal = -8000 cls.rule0.enabled = True + cls.rule1 = hwsim.rules.create() + cls.rule1.source = rad1.addresses[0] + cls.rule1.bidirectional = True + cls.rule1.signal = -8500 + cls.rule1.enabled = True + cls.bss_hostapd[0].set_address('12:00:00:00:00:01') cls.bss_hostapd[1].set_address('12:00:00:00:00:02') @@ -95,6 +104,7 @@ class Test(unittest.TestCase): IWD.clear_storage() cls.bss_hostapd = None cls.rule0.remove() + cls.rule1.remove() if __name__ == '__main__': unittest.main(exit=True)