From patchwork Thu Jun 8 15:25:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 773336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3wk8Qr2FW8z9ryv for ; Fri, 9 Jun 2017 01:26:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iDRd/Smy"; dkim-atps=neutral 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=Yu9b7871f8HUOGGh2FQuh5ca4cTaa894bYjoT7iHnVw=; b=iDR d/Smyv1fY6kTfdyrx9WmEbq62pZv2bwiFwY1+vJYSPrOxoofoxVd0JrJN1w2ziwha7GEyyrPt8az7 jnlgiJlekGVtvZmTOlPZU+8IMyWnrRvYG4oCPAq2iBOZwN4NvaX1ECIAB2ii+M/u2z9ppN3g5T4N+ cfvXOOTJLUDcrw1KnGwpOSESxEmp//C0dmBJAX64k5rcPMUXMTbPuTcGLNh0uXihNCjnFsk+kz+yq SukFYvPE6G58rd3t0lZ/Wy31ixq+Pk+sMefaTk9YAjv5qLIo/MDCI2SjecW6iRE9a/ZFTXYofSY50 hoUH19oBXGlBoJe4e/FK/Y2d6mzf0aA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dIzJv-0000t8-RO; Thu, 08 Jun 2017 15:25:59 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dIzJs-0000mb-8K for hostap@lists.infradead.org; Thu, 08 Jun 2017 15:25:57 +0000 Received: from v-f24-64.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id 75FA6409E08; Thu, 8 Jun 2017 08:25:33 -0700 (PDT) From: greearb@candelatech.com To: hostap@lists.infradead.org Subject: [PATCH] wpa_cli: Fix endless loop relating to STA-NEXT Date: Thu, 8 Jun 2017 08:25:28 -0700 Message-Id: <1496935528-24089-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.7.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170608_082556_359792_DF1456B2 X-CRM114-Status: UNSURE ( 6.35 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 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 -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 Starting 'wpa_cli -g /foo' against a supplicant that did not have AP mode support compiled in would cause an endless loop of log messages in the supplicant, and wpa_cli would not actually work properly. This fix was inspired by one posted by Denton Gentry: http://lists.infradead.org/pipermail/lede-dev/2017-April/007002.html Signed-off-by: Ben Greear --- wpa_supplicant/wpa_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 95e83c2..1680c54 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -1825,7 +1825,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd, } buf[len] = '\0'; - if (os_memcmp(buf, "FAIL", 4) == 0) + if (os_memcmp(buf, "FAIL", 4) == 0 || memcmp(buf, "UNKNOWN COMMAND", 15) == 0) return -1; if (print) printf("%s", buf);