libiwinfo:
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 29 Apr 2011 16:41:35 +0000 (16:41 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 29 Apr 2011 16:41:35 +0000 (16:41 +0000)
- don't assume madwifi and nl80211 backends if no backend given
- only print intersection of group and unicast ciphers in crypto description
- fix crypto detection on madwifi in client mode
- bump pkg revision

contrib/package/iwinfo/Makefile
contrib/package/iwinfo/src/Makefile
contrib/package/iwinfo/src/iwinfo_lualib.c
contrib/package/iwinfo/src/iwinfo_madwifi.c

index 278bdecb1040d1d97c7013d6cc5e9b6ab3dcba52..90d9bbaa0670ee17dd38c1c18f7f1f6818eecf59 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
+# Copyright (C) 2010-2011 Jo-Philipp Wich <xm@subsignal.org>
 #
 # This is free software, licensed under the GPL 2 license.
 #
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libiwinfo
-PKG_RELEASE:=13
+PKG_RELEASE:=14
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index 024582b0be2c4c8b0cd85277c1b1369f88e075e4..a7a7b9a5813641bba63031a8dd1c1b4d6d96ec99 100644 (file)
@@ -1,4 +1,4 @@
-IWINFO_BACKENDS   = $(if $(BACKENDS),$(BACKENDS),madwifi nl80211)
+IWINFO_BACKENDS   = $(BACKENDS)
 IWINFO_LDFLAGS    = $(LDFLAGS) -shared -llua
 IWINFO_CFLAGS     = $(CFLAGS) -std=gnu99 -fstrict-aliasing
 IWINFO_SO         = iwinfo.so
index b327d08d8034162e3f44354943d8b260c04f8f66..516b11fffce9d54a4a2bd8820928bbc57a0045cd 100644 (file)
@@ -417,19 +417,22 @@ static char * iwinfo_crypto_desc(struct iwinfo_crypto_entry *c)
                                        case 3:
                                                sprintf(desc, "mixed WPA/WPA2 %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
-                                                       iwinfo_crypto_print_ciphers(c->pair_ciphers));
+                                                       iwinfo_crypto_print_ciphers(
+                                                               c->pair_ciphers & c->group_ciphers));
                                                break;
 
                                        case 2:
                                                sprintf(desc, "WPA2 %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
-                                                       iwinfo_crypto_print_ciphers(c->pair_ciphers));
+                                                       iwinfo_crypto_print_ciphers(
+                                                               c->pair_ciphers & c->group_ciphers));
                                                break;
 
                                        case 1:
                                                sprintf(desc, "WPA %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
-                                                       iwinfo_crypto_print_ciphers(c->pair_ciphers));
+                                                       iwinfo_crypto_print_ciphers(
+                                                               c->pair_ciphers & c->group_ciphers));
                                                break;
                                }
                        }
index 59c42dbc9fa4be5c17342076f5acf948b3f7a541..54a77cd4dc5643dac0950bd24decb969aedaab46 100644 (file)
@@ -560,9 +560,11 @@ int madwifi_get_encryption(const char *ifname, char *buf)
        if( madwifi_wrq(&wrq, ifname, SIOCGIWENCODE, keybuf, sizeof(keybuf)) < 0 )
                return -1;
 
+#if 0
        /* Have any encryption? */
        if( (wrq.u.data.flags & IW_ENCODE_DISABLED) || (wrq.u.data.length == 0) )
                return 0;
+#endif
 
        /* Save key len */
        key_len = wrq.u.data.length;
@@ -628,7 +630,7 @@ int madwifi_get_encryption(const char *ifname, char *buf)
                if( c->wpa_version && ciphers & (1 << IEEE80211_CIPHER_CKIP) )
                        c->pair_ciphers |= IWINFO_CIPHER_CKIP;
 
-               if( ciphers & (1 << IEEE80211_CIPHER_WEP) )
+               if( !c->pair_ciphers && ciphers & (1 << IEEE80211_CIPHER_WEP) )
                {
                        switch(key_len) {
                                case 13: