X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fiwinfo%2Fsrc%2Fiwinfo_lualib.c;h=8eb4ad5dc1bc0b8eac8b001d546053ef87e06606;hp=a798d772903d9e06a3500ca0597b499bd3292f87;hb=9fde34000dca2a7bd58f48e1c37e389bb98136a6;hpb=0f242f2f503258c1902a9ea7317b04231360ec88 diff --git a/libs/iwinfo/src/iwinfo_lualib.c b/libs/iwinfo/src/iwinfo_lualib.c index a798d7729..8eb4ad5dc 100644 --- a/libs/iwinfo/src/iwinfo_lualib.c +++ b/libs/iwinfo/src/iwinfo_lualib.c @@ -23,12 +23,12 @@ static int iwinfo_L_type(lua_State *L) { const char *ifname = luaL_checkstring(L, 1); - if( wl_probe(ifname) ) - lua_pushstring(L, "wl"); - - else if( madwifi_probe(ifname) ) + if( madwifi_probe(ifname) ) lua_pushstring(L, "madwifi"); + else if( wl_probe(ifname) ) + lua_pushstring(L, "wl"); + else if( wext_probe(ifname) ) lua_pushstring(L, "wext"); @@ -161,44 +161,47 @@ static int iwinfo_L_scanlist(lua_State *L, int (*func)(const char *, char *, int lua_setfield(L, -2, "signal"); /* Crypto */ - lua_pushinteger(L, e->crypto.wpa_version); - lua_setfield(L, -2, "wpa"); - lua_pushboolean(L, (!e->crypto.wpa_version && e->crypto.enabled)); lua_setfield(L, -2, "wep"); - lua_newtable(L); - for( j = 0, y = 1; j < IW_IE_CYPHER_NUM; j++ ) + if( e->crypto.wpa_version ) { - if( e->crypto.group_ciphers & (1<crypto.wpa_version); + lua_setfield(L, -2, "wpa"); + + lua_newtable(L); + for( j = 0, y = 1; j < IW_IE_CYPHER_NUM; j++ ) { - lua_pushstring(L, iw_ie_cypher_name[j]); - lua_rawseti(L, -2, y++); + if( e->crypto.group_ciphers & (1<crypto.pair_ciphers & (1<crypto.pair_ciphers & (1<crypto.auth_suites & (1<crypto.auth_suites & (1<