~ubuntu-core-dev/network-manager-applet/ubuntu.intrepid.0.7

« back to all changes in this revision

Viewing changes to src/applet-device-wifi.c

  • Committer: Alexander Sack
  • Date: 2008-10-15 22:35:20 UTC
  • mfrom: (398.1.411)
  • Revision ID: asac@jwsdot.com-20081015223520-7fa05uu3a2y4aun8
new upstream snapshot Wed 2008-10-15 19:46:45 +0000 (rev 809)

Show diffs side-by-side

added added

removed removed

Lines of Context:
228
228
                goto none;
229
229
 
230
230
        /* Static WEP, Dynamic WEP, or LEAP */
231
 
        if (   (flags & NM_802_11_AP_FLAGS_PRIVACY)
232
 
            && (wpa_flags == NM_802_11_AP_SEC_NONE)
233
 
            && (rsn_flags == NM_802_11_AP_SEC_NONE)) {
234
 
                sec->key_mgmt = g_strdup ("none");
235
 
                sec->wep_tx_keyidx = 0;
236
 
                return sec;
 
231
        if (flags & NM_802_11_AP_FLAGS_PRIVACY) {
 
232
                if ((dev_caps & NM_WIFI_DEVICE_CAP_RSN) || (dev_caps & NM_WIFI_DEVICE_CAP_WPA)) {
 
233
                        /* If the device can do WPA/RSN but the AP has no WPA/RSN informatoin
 
234
                         * elements, it must be LEAP or static/dynamic WEP.
 
235
                         */
 
236
                        if ((wpa_flags == NM_802_11_AP_SEC_NONE) && (rsn_flags == NM_802_11_AP_SEC_NONE)) {
 
237
                                sec->key_mgmt = g_strdup ("none");
 
238
                                sec->wep_tx_keyidx = 0;
 
239
                                return sec;
 
240
                        }
 
241
                        /* Otherwise, the AP supports WPA or RSN, which is preferred */
 
242
                } else {
 
243
                        /* Device can't do WPA/RSN, but can at least pass through the
 
244
                         * WPA/RSN information elements from a scan.  Since Privacy was
 
245
                         * advertised, LEAP or static/dynamic WEP must be in use.
 
246
                         */
 
247
                        sec->key_mgmt = g_strdup ("none");
 
248
                        sec->wep_tx_keyidx = 0;
 
249
                        return sec;
 
250
                }
237
251
        }
238
252
 
239
253
        /* Stuff after this point requires infrastructure */