From: Jouni Malinen Date: Wed, 10 Aug 2011 10:29:32 +0000 (+0300) Subject: Add SSID as a separate item in AP mode Beacon setup X-Git-Tag: hostap-1-bp~265 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccb941e6da3122937cf87a8145a17907dae534a5;p=thirdparty%2Fhostap.git Add SSID as a separate item in AP mode Beacon setup This makes it easier for drivers that need the SSID to get it from the Beacon setup operation without having to parse the Beacon IEs. --- diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 136856c43..3fd49f285 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -518,6 +518,8 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd) params.tail_len = tail_len; params.dtim_period = hapd->conf->dtim_period; params.beacon_int = hapd->iconf->beacon_int; + params.ssid = (u8 *) hapd->conf->ssid.ssid; + params.ssid_len = hapd->conf->ssid.ssid_len; if (hostapd_drv_set_ap(hapd, ¶ms)) wpa_printf(MSG_ERROR, "Failed to set beacon parameters"); diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 36e6ca905..e2d0f8bdf 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -530,6 +530,16 @@ struct wpa_driver_ap_params { * beacon_int - Beacon interval */ int beacon_int; + + /** + * ssid - The SSID to use in Beacon/Probe Response frames + */ + const u8 *ssid; + + /** + * ssid_len - Length of the SSID (1..32) + */ + size_t ssid_len; }; /** diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 9726cbf18..1cb21965a 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3847,6 +3847,8 @@ static int wpa_driver_nl80211_set_ap(void *priv, NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, ifindex); NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, params->beacon_int); NLA_PUT_U32(msg, NL80211_ATTR_DTIM_PERIOD, params->dtim_period); + NLA_PUT(msg, NL80211_ATTR_SSID, params->ssid_len, + params->ssid); ret = send_and_recv_msgs(drv, msg, NULL, NULL); if (ret) {