Browse Source

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.
Jouni Malinen 13 years ago
parent
commit
ccb941e6da
3 changed files with 14 additions and 0 deletions
  1. 2 0
      src/ap/beacon.c
  2. 10 0
      src/drivers/driver.h
  3. 2 0
      src/drivers/driver_nl80211.c

+ 2 - 0
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, &params))
 		wpa_printf(MSG_ERROR, "Failed to set beacon parameters");
 

+ 10 - 0
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;
 };
 
 /**

+ 2 - 0
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) {