Searching on IW_ESSID_MAX_SIZE across wlan drivers
shows many different ways to determine the length of the ESS-ID.
This could be simpler.
I'd suggest determine the length of the ESS string in a way that
works for both the old and the new version of wireless extensions,
by double checking if the last character is a \0 byte.
In the meantime, users should just enter a dummy character at
the end of the ESS in /etc/network/interfaces or the network config tool.
linux-source-2.6.20/ubuntu/wireless/acx/ioctl.c :
if (dwrq->length > IW_ESSID_MAX_SIZE+1) { result = -E2BIG; goto end_unlock;
}
if (len > sizeof(adev->essid)) len = sizeof(adev->essid); memcpy(adev->essid, extra, len-1); adev->essid[len-1] = '\0';
/* Paranoia: just in case there is a '\0'... */ adev->essid_len = strlen(adev->essid);
Searching on IW_ESSID_MAX_SIZE across wlan drivers
shows many different ways to determine the length of the ESS-ID.
This could be simpler.
I'd suggest determine the length of the ESS string in a way that
works for both the old and the new version of wireless extensions,
by double checking if the last character is a \0 byte.
In the meantime, users should just enter a dummy character at interfaces or the network config tool.
the end of the ESS in /etc/network/
linux-source- 2.6.20/ ubuntu/ wireless/ acx/ioctl. c :
if (dwrq->length > IW_ESSID_ MAX_SIZE+ 1) {
result = -E2BIG;
goto end_unlock;
}
if (len > sizeof( adev->essid) )
len = sizeof( adev->essid) ;
memcpy( adev->essid, extra, len-1);
adev- >essid[ len-1] = '\0';
adev- >essid_ len = strlen( adev->essid) ;
/* Paranoia: just in case there is a '\0'... */
at76/at76c503.c :
ipw3945/ipw3945.c :
#if WIRELESS_EXT > 20
#define IW_ESSID_FIX 0
#else
#define IW_ESSID_FIX 1
...
#endif
iwlwifi/base.c :
essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
*d++ = '\\';
*d++ = '0';
s++;
*d++ = *s++;
while (essid_len--) {
if (*s == '\0') {
} else {
}
}
*d = '\0';
...