fix -Wdangling-else warnings
[project/iwinfo.git] / iwinfo_utils.c
index b4f98a903a721e4395e2fe734524b16e23d2c0fe..c15b30517235ed0b34997922141a2b3467352cf7 100644 (file)
@@ -285,7 +285,7 @@ int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id)
        return (id->vendor_id && id->device_id) ? 0 : -1;
 }
 
-static void iwinfo_parse_rsn_cipher(uint8_t idx, uint8_t *ciphers)
+static void iwinfo_parse_rsn_cipher(uint8_t idx, uint16_t *ciphers)
 {
        switch (idx)
        {
@@ -312,11 +312,20 @@ static void iwinfo_parse_rsn_cipher(uint8_t idx, uint8_t *ciphers)
                        *ciphers |= IWINFO_CIPHER_WEP104;
                        break;
 
+               case 8:
+                       *ciphers |= IWINFO_CIPHER_GCMP;
+                       break;
+
+               case 9:
+                       *ciphers |= IWINFO_CIPHER_GCMP256;
+                       break;
+
+               case 10:
+                       *ciphers |= IWINFO_CIPHER_CCMP256;
+                       break;
+
                case 6:  /* AES-128-CMAC */
                case 7:  /* No group addressed */
-               case 8:  /* GCMP */
-               case 9:  /* GCMP-256 */
-               case 10: /* CCMP-256 */
                case 11: /* BIP-GMAC-128 */
                case 12: /* BIP-GMAC-256 */
                case 13: /* BIP-CMAC-256 */
@@ -325,7 +334,7 @@ static void iwinfo_parse_rsn_cipher(uint8_t idx, uint8_t *ciphers)
 }
 
 void iwinfo_parse_rsn(struct iwinfo_crypto_entry *c, uint8_t *data, uint8_t len,
-                                         uint8_t defcipher, uint8_t defauth)
+                                         uint16_t defcipher, uint8_t defauth)
 {
        uint16_t i, count;
        uint8_t wpa_version = 0;
@@ -419,11 +428,11 @@ void iwinfo_parse_rsn(struct iwinfo_crypto_entry *c, uint8_t *data, uint8_t len,
 
                                case 11: /* 802.1x Suite-B */
                                case 12: /* 802.1x Suite-B-192 */
+                               case 13: /* FT/802.1x SHA-384 */
                                        c->wpa_version |= 4;
                                        c->auth_suites |= IWINFO_KMGMT_8021x;
                                        break;
 
-                               case 13: /* FT/802.1x SHA-384 */
                                case 14: /* FILS SHA-256 */
                                case 15: /* FILS SHA-384 */
                                case 16: /* FT/FILS SHA-256 */