Received: by 10.223.176.5 with SMTP id f5csp981669wra; Fri, 2 Feb 2018 09:12:42 -0800 (PST) X-Google-Smtp-Source: AH8x227bc+oyi+1DtsrqGWxAizvZbVaKjIVNHVfDDkQIwWQ8RS5OVR+MoowAMbTxEDrTS3juGaHQ X-Received: by 10.99.96.88 with SMTP id u85mr2042218pgb.231.1517591562849; Fri, 02 Feb 2018 09:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517591562; cv=none; d=google.com; s=arc-20160816; b=ZI3+KdPLkFMC6GmxLVtkH22pJYu6yl+VTdK7lzeXFs6H2/tuBBx+gp2p/NXUqLBaVo zCkFux/y8T4T6nKPu4AlgwaKVdebkjLEKdBXnN4xRWv5bvcc6ftvGaq9WdhqlbY9k2g5 DIL1O999NXgfUpcBdMbRuOaKIygeRVyHbG6zhEvGS+TeTJeRgECuBbQbEADA5HyU/I/f 8p5AJ3L9aV7mvomn7tEF1pg+rTg+e5jLkGL6grY9i4RTCePoLQulbJ30r7cm8QkLANDd NLDkJkRL34p77GVjjGlO9U+AQexJw6DSKQPkhE/YbnR6ikxz+0XZRAZu1SJFC7j7GoyV CDow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=gXbTSgM9i01TGn4VNRWbSvCcRQgTYC2AYil/nCQUkI8=; b=swDuKyQsG3hRmzB8SI0sJYhODVD/PhwLdGYnTMzE5RDkLdPyZwOD8b5/S1b00XfOOi 2tviqAV2YypejVHonfcfM/UsgBslvPQFYjMdmDyMJbLP226memlCKLq2HPlxmA/Uc93f 1uBph+KpiK0wq0fhI4WlA0Mp55mdg/t64e52QZ5n58l/o0KM4DWefOgkIW1bk9rUerKu Hg6N8hMdXcnodrvtfjWuKgkvFOzkh5ssg5Mx/q4k91uehyPhKb+xwzRuuLR8w0DEP2Yx CGoQFUU7TItLi65kJtgSZoHr3V5nZmGzXmsMUwH2tAEKq5eoGOsa5PrPai36SIloiyNI fycw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i14si1684805pgp.516.2018.02.02.09.12.28; Fri, 02 Feb 2018 09:12:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752929AbeBBRLS (ORCPT + 99 others); Fri, 2 Feb 2018 12:11:18 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36634 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbeBBRFw (ORCPT ); Fri, 2 Feb 2018 12:05:52 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A86C1E16; Fri, 2 Feb 2018 17:05:51 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Larry Finger , Sasha Levin Subject: [PATCH 4.9 69/86] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID Date: Fri, 2 Feb 2018 17:58:29 +0100 Message-Id: <20180202140829.065497605@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140822.679101338@linuxfoundation.org> References: <20180202140822.679101338@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Larry Finger [ Upstream commit b77992d2df9e47144354d1b25328b180afa33442 ] When not associated with an AP, wifi device drivers should respond to the SIOCGIWESSID ioctl with a zero-length string for the SSID, which is the behavior expected by dhcpcd. Currently, this driver returns an error code (-1) from the ioctl call, which causes dhcpcd to assume that the device is not a wireless interface and therefore it fails to work correctly with it thereafter. This problem was reported and tested at https://github.com/lwfinger/rtl8188eu/issues/234. Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -1397,19 +1397,13 @@ static int rtw_wx_get_essid(struct net_d if ((check_fwstate(pmlmepriv, _FW_LINKED)) || (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) { len = pcur_bss->Ssid.SsidLength; - - wrqu->essid.length = len; - memcpy(extra, pcur_bss->Ssid.Ssid, len); - - wrqu->essid.flags = 1; } else { - ret = -1; - goto exit; + len = 0; + *extra = 0; } - -exit: - + wrqu->essid.length = len; + wrqu->essid.flags = 1; return ret; }