From patchwork Fri Mar 16 21:31:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 887175 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=candelatech.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pggfHoZk"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 402zXL5d8Fz9sSk for ; Sat, 17 Mar 2018 08:45:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=MGmHXtGMX2KIELMdHH98N+AqBOYtZ6wh7xn7dd7TppI=; b=pgg fHoZk0bgKSZNmIBlYyOUFSEhxnWgp0N1qjvW0UT1ceKkFNbce4LuekmpCToXn3wesxmeaeuVBJPs/ 7Cclg0U0wZZddUOiEXaQYyz11jP0gV59zN5oVfHJrbd6slJlX9HU48cSSvAj1Jp18D5+2y3AcVLxu G0Q4bdMOPtyMSJxADcsXZjlx9aJNxcnaPXtK8rpN53FnuHsE4j4G8Fhmr2zZn1G9nLm3FVL2QgIlf lZtD39grDRuiDmG2IuC2jRYIu0aDN4mVkwY2XQ8eeNBSbP5UdtA2ZLNX0cJLIquqfM6i2pwkWgqoN Uuw5EiwItqRnB0GZL0D7tISUjt5+NVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewxA7-0006yZ-97; Fri, 16 Mar 2018 21:45:19 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewwxY-00032p-Ug for hostap@lists.infradead.org; Fri, 16 Mar 2018 21:32:22 +0000 Received: from ben-dt3.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id E70F340A539; Fri, 16 Mar 2018 14:32:03 -0700 (PDT) From: greearb@candelatech.com To: hostap@lists.infradead.org Subject: [PATCH v2] nl80211: Add MLME auth work-around for -EEXIST errno Date: Fri, 16 Mar 2018 14:31:55 -0700 Message-Id: <1521235915-27623-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.4.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180316_143221_026788_63A12681 X-CRM114-Status: GOOD ( 11.22 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ben Greear MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ben Greear The 4.9 kernel, at least, can return EEXIST when trying to auth a station that already exists. Signed-off-by: Ben Greear --- NOTE: I cannot manage to compile top-of-tree hostapd, due to this: [greearb@ben-dt3 hostapd]$ make ../src/drivers/driver_nl80211.c:17:31: fatal error: netlink/genl/genl.h: No such file or directory compilation terminated. Makefile:1247: recipe for target '../src/drivers/driver_nl80211.o' failed make: *** [../src/drivers/driver_nl80211.o] Error 1 So, this patch is not even properly compile tested unfortunately. We have seen this bug in multiple places, but it is difficult to reproduce. Here is a link to someone else that appears to have hit this issue. https://github.com/greearb/ath10k-ct/issues/18 src/drivers/driver_nl80211.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 329be02..fd53e4f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3345,10 +3345,10 @@ retry: msg = NULL; if (ret) { wpa_dbg(drv->ctx, MSG_DEBUG, - "nl80211: MLME command failed (auth): ret=%d (%s)", - ret, strerror(-ret)); + "nl80211: MLME command failed (auth): count=%d ret=%d (%s)", + count, ret, strerror(-ret)); count++; - if (ret == -EALREADY && count == 1 && params->bssid && + if (((ret == -EALREADY) || (ret == -EEXIST)) && count == 1 && params->bssid && !params->local_state_change) { /* * mac80211 does not currently accept new