All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID
@ 2017-11-25 19:32 Larry Finger
  2017-11-28 13:17 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2017-11-25 19:32 UTC (permalink / raw)
  To: gregkh; +Cc: netdev, devel, Larry Finger

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 <Larry.Finger@lwfinger.net>
---

v2 - completed missing subject
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index c0664dc80bf2..446310775e90 100644
--- 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_device *dev,
 	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;
 }
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID
  2017-11-25 19:32 [PATCH V2] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID Larry Finger
@ 2017-11-28 13:17 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2017-11-28 13:17 UTC (permalink / raw)
  To: Larry Finger; +Cc: devel, netdev

On Sat, Nov 25, 2017 at 01:32:38PM -0600, Larry Finger wrote:
> 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 <Larry.Finger@lwfinger.net>
> ---
> 
> v2 - completed missing subject

Ah, nevermind, you already did...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-28 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-25 19:32 [PATCH V2] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID Larry Finger
2017-11-28 13:17 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.