~ubuntu-branches/ubuntu/wily/linux-ti-omap4/wily

« back to all changes in this revision

Viewing changes to net/mac80211/mlme.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 3.5.0-25.38
  • Date: 2013-02-20 22:03:31 UTC
  • mfrom: (74.1.1 quantal-proposed)
  • Revision ID: package-import@ubuntu.com-20130220220331-0ea4l33x3cr61nch
Tags: 3.5.0-220.28
* Release Tracking Bug
  - LP: #1130311

[ Paolo Pisati ]

* rebased on Ubuntu-3.5.0-25.38

[ Ubuntu: 3.5.0-25.38 ]

* Release Tracking Bug
  - LP: #1129472
* ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up()
  - LP: #1119885, #1129192
  - CVE-2013-0871
* ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL
  - LP: #1119885, #1129192
  - CVE-2013-0871
* wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED
  task
  - LP: #1119885, #1129192
  - CVE-2013-0871

Show diffs side-by-side

added added

removed removed

Lines of Context:
994
994
                if (beaconint_us > latency) {
995
995
                        local->ps_sdata = NULL;
996
996
                } else {
997
 
                        struct ieee80211_bss *bss;
998
997
                        int maxslp = 1;
999
 
                        u8 dtimper;
1000
 
 
1001
 
                        bss = (void *)found->u.mgd.associated->priv;
1002
 
                        dtimper = bss->dtim_period;
 
998
                        u8 dtimper = found->u.mgd.dtim_period;
1003
999
 
1004
1000
                        /* If the TIM IE is invalid, pretend the value is 1 */
1005
1001
                        if (!dtimper)
1305
1301
 
1306
1302
        ieee80211_led_assoc(local, 1);
1307
1303
 
1308
 
        if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD)
1309
 
                bss_conf->dtim_period = bss->dtim_period;
1310
 
        else
 
1304
        if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD) {
 
1305
                /*
 
1306
                 * If the AP is buggy we may get here with no DTIM period
 
1307
                 * known, so assume it's 1 which is the only safe assumption
 
1308
                 * in that case, although if the TIM IE is broken powersave
 
1309
                 * probably just won't work at all.
 
1310
                 */
 
1311
                bss_conf->dtim_period = sdata->u.mgd.dtim_period ?: 1;
 
1312
        } else {
1311
1313
                bss_conf->dtim_period = 0;
 
1314
        }
1312
1315
 
1313
1316
        bss_conf->assoc = 1;
1314
1317
 
1441
1444
        del_timer_sync(&sdata->u.mgd.bcn_mon_timer);
1442
1445
        del_timer_sync(&sdata->u.mgd.timer);
1443
1446
        del_timer_sync(&sdata->u.mgd.chswitch_timer);
 
1447
 
 
1448
        sdata->vif.bss_conf.dtim_period = 0;
1444
1449
}
1445
1450
 
1446
1451
void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
2205
2210
        struct ieee80211_channel *channel;
2206
2211
        bool need_ps = false;
2207
2212
 
2208
 
        if (sdata->u.mgd.associated &&
2209
 
            ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) {
2210
 
                bss = (void *)sdata->u.mgd.associated->priv;
 
2213
        if ((sdata->u.mgd.associated &&
 
2214
             ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) ||
 
2215
            (sdata->u.mgd.assoc_data &&
 
2216
             ether_addr_equal(mgmt->bssid,
 
2217
                              sdata->u.mgd.assoc_data->bss->bssid))) {
2211
2218
                /* not previously set so we may need to recalc */
2212
 
                need_ps = !bss->dtim_period;
 
2219
                need_ps = sdata->u.mgd.associated && !sdata->u.mgd.dtim_period;
 
2220
 
 
2221
                if (elems->tim && !elems->parse_error) {
 
2222
                        struct ieee80211_tim_ie *tim_ie = elems->tim;
 
2223
                        sdata->u.mgd.dtim_period = tim_ie->dtim_period;
 
2224
                }
2213
2225
        }
2214
2226
 
2215
2227
        if (elems->ds_params && elems->ds_params_len == 1)
3413
3425
        /* kick off associate process */
3414
3426
 
3415
3427
        ifmgd->assoc_data = assoc_data;
 
3428
        ifmgd->dtim_period = 0;
3416
3429
 
3417
3430
        err = ieee80211_prep_connection(sdata, req->bss, true);
3418
3431
        if (err)
3419
3432
                goto err_clear;
3420
3433
 
3421
 
        if (!bss->dtim_period &&
3422
 
            sdata->local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD) {
3423
 
                /*
3424
 
                 * Wait up to one beacon interval ...
3425
 
                 * should this be more if we miss one?
3426
 
                 */
3427
 
                printk(KERN_DEBUG "%s: waiting for beacon from %pM\n",
3428
 
                       sdata->name, ifmgd->bssid);
3429
 
                assoc_data->timeout = TU_TO_EXP_TIME(req->bss->beacon_interval);
 
3434
        if (sdata->local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD) {
 
3435
                const u8 *beacon_ies = req->bss->beacon_ies;
 
3436
                size_t beacon_ies_len = req->bss->len_beacon_ies;
 
3437
 
 
3438
                if (!beacon_ies_len) {
 
3439
                        /*
 
3440
                         * Wait up to one beacon interval ...
 
3441
                         * should this be more if we miss one?
 
3442
                         */
 
3443
                        printk(KERN_DEBUG "%s: waiting for beacon from %pM\n",
 
3444
                               sdata->name, ifmgd->bssid);
 
3445
                        assoc_data->timeout =
 
3446
                                TU_TO_EXP_TIME(req->bss->beacon_interval);
 
3447
                } else {
 
3448
                        const u8 *tim_ie = cfg80211_find_ie(WLAN_EID_TIM,
 
3449
                                                            beacon_ies,
 
3450
                                                            beacon_ies_len);
 
3451
                        if (tim_ie && tim_ie[1] >=
 
3452
                                        sizeof(struct ieee80211_tim_ie)) {
 
3453
                                const struct ieee80211_tim_ie *tim;
 
3454
                                tim = (void *)(tim_ie + 2);
 
3455
                                ifmgd->dtim_period = tim->dtim_period;
 
3456
                        }
 
3457
                        assoc_data->have_beacon = true;
 
3458
                        assoc_data->sent_assoc = false;
 
3459
                        assoc_data->timeout = jiffies;
 
3460
                }
3430
3461
        } else {
3431
3462
                assoc_data->have_beacon = true;
3432
3463
                assoc_data->sent_assoc = false;