1.WPA_SUPPLICANT当遇到WEP加密时,由于无法判断是采用OPEN/SHARE,通常会在声称.conf文件中加入
auth_alg=OPEN SHARED(至少Android遇到),但事实上某些wifi网卡驱动不能实现同时OPEN和SHARED同时设置,我用的RT2070就不能够了,任意时刻只能用一个,而Atheroid就可以同时设两个。这里给出解决不能同时设置的方法,在wpa_supplicant.c:wpa_supplicant_associate()中加入以下内容:
if (ssid->auth_alg) {
algs = 0;
if (ssid->auth_alg & WPA_AUTH_ALG_OPEN)
algs |= AUTH_ALG_OPEN_SYSTEM;
if (ssid->auth_alg & WPA_AUTH_ALG_SHARED)
algs |= AUTH_ALG_SHARED_KEY;
if (ssid->auth_alg & WPA_AUTH_ALG_LEAP)
algs |= AUTH_ALG_LEAP;
wpa_printf(MSG_DEBUG, "Overriding auth_alg selection: 0x%x",
algs);
if ((algs & AUTH_ALG_OPEN_SYSTEM) && (algs & AUTH_ALG_SHARED_KEY) ) {
algs = AUTH_ALG_SHARED_KEY;
G_TRY_CONNECT ++;
if (G_TRY_CONNECT >= 4) {
algs = AUTH_ALG_OPEN_SYSTEM;
wpa_printf(MSG_DEBUG, "RAYDEBUG--------------------change to ALG_OPEN_SYSTEM");
}
}
}
阅读(4296) | 评论(2) | 转发(1) |