]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HS 2.0R2 AP: Add STA's Hotspot 2.0 Release Number into Access-Request
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 21 Nov 2012 22:28:04 +0000 (00:28 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 25 Feb 2014 23:24:24 +0000 (01:24 +0200)
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 <jouni@qca.qualcomm.com>

src/ap/ieee802_1x.c

index 49933780dfaead1bead3f09521585871e9301f05..9c2488cdd0261769884901834b759f4db6a8aaf7 100644 (file)
@@ -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 */