Add Mobility-Domain-Id into RADIUS messages

This adds hostapd support for the new Mobility-Domain-Id attribute
defined in RFC 7268. This attribute contains the mobility domain id and
it is added whenever the station negotiates use of FT.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-07-31 19:00:37 +03:00
parent 4a0693a4d5
commit 69002fb0a8
3 changed files with 18 additions and 0 deletions

View File

@ -357,6 +357,21 @@ static int add_common_radius_sta_attr(struct hostapd_data *hapd,
}
}
#ifdef CONFIG_IEEE80211R
if (hapd->conf->wpa && wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt) &&
sta->wpa_sm &&
(wpa_key_mgmt_ft(wpa_auth_sta_key_mgmt(sta->wpa_sm)) ||
sta->auth_alg == WLAN_AUTH_FT) &&
!hostapd_config_get_radius_attr(req_attr,
RADIUS_ATTR_MOBILITY_DOMAIN_ID) &&
!radius_msg_add_attr_int32(msg, RADIUS_ATTR_MOBILITY_DOMAIN_ID,
WPA_GET_BE16(
hapd->conf->mobility_domain))) {
wpa_printf(MSG_ERROR, "Could not add Mobility-Domain-Id");
return -1;
}
#endif /* CONFIG_IEEE80211R */
return 0;
}

View File

@ -233,6 +233,8 @@ static struct radius_attr_type radius_attrs[] =
{ RADIUS_ATTR_NAS_IPV6_ADDRESS, "NAS-IPv6-Address", RADIUS_ATTR_IPV6 },
{ RADIUS_ATTR_ERROR_CAUSE, "Error-Cause", RADIUS_ATTR_INT32 },
{ RADIUS_ATTR_EAP_KEY_NAME, "EAP-Key-Name", RADIUS_ATTR_HEXDUMP },
{ RADIUS_ATTR_MOBILITY_DOMAIN_ID, "Mobility-Domain-Id",
RADIUS_ATTR_INT32 },
};
#define RADIUS_ATTRS ARRAY_SIZE(radius_attrs)

View File

@ -92,6 +92,7 @@ enum { RADIUS_ATTR_USER_NAME = 1,
RADIUS_ATTR_NAS_IPV6_ADDRESS = 95,
RADIUS_ATTR_ERROR_CAUSE = 101,
RADIUS_ATTR_EAP_KEY_NAME = 102,
RADIUS_ATTR_MOBILITY_DOMAIN_ID = 177,
};