From 7bc9c25d1f516ba6364b0311c88a821dcf5b9ffc Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 22 Nov 2012 00:28:04 +0200 Subject: [PATCH] HS 2.0R2 AP: Add STA's Hotspot 2.0 Release Number into Access-Request If the station indicated support for Hotspot 2.0, send its release number and PPS MO ID in Access-Request messages using the WFA RADIUS VSA. Signed-hostap: Jouni Malinen --- src/ap/ieee802_1x.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index 49933780d..9c2488cdd 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -531,6 +531,28 @@ static void ieee802_1x_encapsulate_radius(struct hostapd_data *hapd, "version"); goto fail; } + + if (sta->hs20_ie && wpabuf_len(sta->hs20_ie) > 0) { + const u8 *pos; + u8 buf[3]; + u16 id; + pos = wpabuf_head_u8(sta->hs20_ie); + buf[0] = (*pos) >> 4; + if (((*pos) & HS20_PPS_MO_ID_PRESENT) && + wpabuf_len(sta->hs20_ie) >= 3) + id = WPA_GET_LE16(pos + 1); + else + id = 0; + WPA_PUT_BE16(buf + 1, id); + if (!radius_msg_add_wfa( + msg, + RADIUS_VENDOR_ATTR_WFA_HS20_STA_VERSION, + buf, sizeof(buf))) { + wpa_printf(MSG_ERROR, "Could not add HS 2.0 " + "STA version"); + goto fail; + } + } } #endif /* CONFIG_HS20 */