Received: by 10.223.176.5 with SMTP id f5csp1022332wra; Fri, 2 Feb 2018 09:52:01 -0800 (PST) X-Google-Smtp-Source: AH8x225ftBNuvPugdsZnulQ6vxA/hsYEYDtdXXgAauEoi6YzZFFQtOe6qFKTy4ui9/XZfOj2p0lN X-Received: by 10.99.95.12 with SMTP id t12mr1951316pgb.291.1517593921821; Fri, 02 Feb 2018 09:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517593921; cv=none; d=google.com; s=arc-20160816; b=jk47Qj33lZa7okZJeP9O0PQK87W9BfB1LNfdQWuPPzdN3NWDHLN47sfbCGKU+Bee87 y4WWp6WHzzh+PbOr5PCIbi/T6AG+EtYAnIq6PQVeF+rV/oV3eR4s0/DPsDTLHfTvqWEG 1+CVSD6aMsW5iLoNzmTgcktvsPB/RpWFdepaNSgI1g8Qobt9uknkNRLODnJd43myPF7H O/E5oqMDCEosYQ5V0OfBm7wdzsQsX1mh1s0YxfTat2GyKg288fDA3EWdiA7varRNo9dz 98+xs4nfol0yU7ISn8PWdVFbN3FvYCWSgPvG56YfNSLsnIxhGYPKJz2YgRh/nZVTGmS8 iLGA== 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=ILog2jm4LIT3wJxY5gJEqLek/sorubsj60gXL5gIDdg=; b=C97EuRVoUHug1QAmeJ2da5kEDa0UsyLLXSnU5QxADk4rWgs7cpF0Tesf5OUmDUvImN OfBnZHt4wEuwEBwelFz3kyGsgvnqp+LwEgittqrQgFKipLUK9m8GlZbv0ljSrE+jjQY7 N7/DhYjVCd3weuBpBlPT++gefTlz7haVUskLsW4ZNesPF1t9sGVaQk8N3qIdlC+3KTdy ReczRUAM4r8qwF6SABvFvLnSdNLPCvJ9dD/nagksR6Bk8zH8jkomogqO5snwKttcrlQP 41LsPNO3GVEkjI8saUcVrOPIM/cdItS/8dSEQQ6TQhb4It9bkf8ep9kTenOPL7cb5j5g T+pQ== 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 z11si98845pgr.460.2018.02.02.09.51.46; Fri, 02 Feb 2018 09:52:01 -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 S1753405AbeBBRuE (ORCPT + 99 others); Fri, 2 Feb 2018 12:50:04 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39146 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752902AbeBBRMy (ORCPT ); Fri, 2 Feb 2018 12:12:54 -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 2B4E6EF7; Fri, 2 Feb 2018 17:12:53 +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.14 126/156] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID Date: Fri, 2 Feb 2018 17:58:27 +0100 Message-Id: <20180202140846.076565864@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@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.14-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 @@ -1395,19 +1395,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; }