Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b77992d2 authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman
Browse files

staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID

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: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c5f39d07
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -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;
}