diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 192f213cf43e..c2416fbd1b27 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -491,6 +491,31 @@ static void ieee80211_config_ap_ssid(struct ieee80211_sub_if_data *sdata, | |||
491 | (params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE); | 491 | (params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE); |
492 | } | 492 | } |
493 | 493 | ||
494 | static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata, | ||
495 | u8 *resp, size_t resp_len) | ||
496 | { | ||
497 | struct sk_buff *new, *old; | ||
498 | |||
499 | if (!resp || !resp_len) | ||
500 | return -EINVAL; | ||
501 | |||
502 | old = sdata->u.ap.probe_resp; | ||
503 | |||
504 | new = dev_alloc_skb(resp_len); | ||
505 | if (!new) | ||
506 | return -ENOMEM; | ||
507 | |||
508 | memcpy(skb_put(new, resp_len), resp, resp_len); | ||
509 | |||
510 | rcu_assign_pointer(sdata->u.ap.probe_resp, new); | ||
511 | synchronize_rcu(); | ||
512 | |||
513 | if (old) | ||
514 | dev_kfree_skb(old); | ||
515 | |||
516 | return 0; | ||
517 | } | ||
518 | |||
494 | /* | 519 | /* |
495 | * This handles both adding a beacon and setting new beacon info | 520 | * This handles both adding a beacon and setting new beacon info |
496 | */ | 521 | */ |
@@ -501,6 +526,7 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, | |||
501 | int new_head_len, new_tail_len; | 526 | int new_head_len, new_tail_len; |
502 | int size; | 527 | int size; |
503 | int err = -EINVAL; | 528 | int err = -EINVAL; |
529 | u32 changed = 0; | ||
504 | 530 | ||
505 | old = rtnl_dereference(sdata->u.ap.beacon); | 531 | old = rtnl_dereference(sdata->u.ap.beacon); |
506 | 532 | ||
@@ -584,11 +610,17 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, | |||
584 | 610 | ||
585 | kfree(old); | 611 | kfree(old); |
586 | 612 | ||
613 | err = ieee80211_set_probe_resp(sdata, params->probe_resp, | ||
614 | params->probe_resp_len); | ||
615 | if (!err) | ||
616 | changed |= BSS_CHANGED_AP_PROBE_RESP; | ||
617 | |||
587 | ieee80211_config_ap_ssid(sdata, params); | 618 | ieee80211_config_ap_ssid(sdata, params); |
619 | changed |= BSS_CHANGED_BEACON_ENABLED | | ||
620 | BSS_CHANGED_BEACON | | ||
621 | BSS_CHANGED_SSID; | ||
588 | 622 | ||
589 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | | 623 | ieee80211_bss_info_change_notify(sdata, changed); |
590 | BSS_CHANGED_BEACON | | ||
591 | BSS_CHANGED_SSID); | ||
592 | return 0; | 624 | return 0; |
593 | } | 625 | } |
594 | 626 | ||