From patchwork Tue Jul 21 12:17:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Marples X-Patchwork-Id: 1332994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=marples.name Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=P4h4oV3n; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=marples.name header.i=@marples.name header.a=rsa-sha256 header.s=mail header.b=GROxmWSo; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9yLl0CQ0z9sQt for ; Tue, 21 Jul 2020 22:18:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:To: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=LCQqvjnV9KDQD6xA5B28jnvdfN0H/IgT8YFfG4jiEuQ=; b=P4h4oV3nL2NImb N8b+UFV8SiW//5TcovazdWWz1dN1TbYpmgL0oNfVlhysdKVcoWWQxbXu3OXCuYcJVeLE6Ksbsku41 Wst7tWGjnTXSuj3GAzytpAmIjkifKfqzbWWB2qYSh7EWrPDfgiW/TYVIy6ynqEPS/3Exz1/4BArX2 wjT7ukKGvxwjRkYGY+qOUAwPOt8oYGky+dmqBNk3Qd/CN6//1i8v72H+QS+d+nl0te/wgPf4EXNjg Ba4Y/zq5FiWCwKILmRgaC87pM5PNQafD/eYM3t5XFIEYXKQOEvVn5ReFlh2yvHQDrq2EYtF7oSlnz uMY5UgoJ/aSCkVZSNV1Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxrDT-0002Xe-QT; Tue, 21 Jul 2020 12:17:51 +0000 Received: from relay2.marples.name ([77.68.23.143]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxrDR-0002Wm-4J for hostap@lists.infradead.org; Tue, 21 Jul 2020 12:17:49 +0000 Received: from mail.marples.name (cpc115040-bour7-2-0-cust370.15-1.cable.virginm.net [81.108.15.115]) by relay2.marples.name (Postfix) with ESMTPS id D8BF3752 for ; Tue, 21 Jul 2020 12:17:44 +0000 (UTC) Received: from [10.73.0.30] (uberpc.marples.name [10.73.0.30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.marples.name (Postfix) with ESMTPSA id 6B7EF13637 for ; Tue, 21 Jul 2020 13:17:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marples.name; s=mail; t=1595333862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MctzC7GlfpTyFHXJmam4StT38iDlFka5hQ0LTJiLKY=; b=GROxmWSobcCteSuOQw6wIhYcb9NV4sTCaT1UZQWTPqoA3QVIwsmi9KJklRy9Iy9x/1Ghr/ 6Y8sTcn/9zbfr6fcntNyZ2ghiVPHRaGD+fYj+6kt0Mim/AJgyhrWzn1VOM4jWWdzi9XBRL w8Ka9TPUmST7Hnk62MGPOjfp2HYAR9c= To: hostap@lists.infradead.org From: Roy Marples Subject: [PATCH] op_classes: Don't report an error when there are none to add Message-ID: Date: Tue, 21 Jul 2020 13:17:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200721_081749_320675_F6DA515C X-CRM114-Status: GOOD ( 14.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Instead, log a diagnostic so that noise to the user is reduced. Signed-off-by: Roy Marples --- wpa_supplicant/op_classes.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/op_classes.c b/wpa_supplicant/op_classes.c index bd97fee54..2494bffb6 100644 --- a/wpa_supplicant/op_classes.c +++ b/wpa_supplicant/op_classes.c @@ -412,9 +412,13 @@ size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s, } *ie_len = wpabuf_len(buf) - 2; - if (*ie_len < 2 || wpabuf_len(buf) > len) { + if (*ie_len < 2) { + wpa_printf(MSG_DEBUG, + "No supported operating classes IE to add"); + res = 0; + } else if (wpabuf_len(buf) > len) { wpa_printf(MSG_ERROR, - "Failed to add supported operating classes IE"); + "Supported operating classes IE exceed length"); res = 0; } else { os_memcpy(pos, wpabuf_head(buf), wpabuf_len(buf));