aboutsummaryrefslogtreecommitdiffstats
path: root/src/fst
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-07-26 07:40:21 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-26 08:21:58 (GMT)
commite49f535dc518f7609fbbe5ecff9966ad271cf3f2 (patch)
tree5012494d19da60cbfbf4c711aa25b3a4c0e11e83 /src/fst
parent94edea89fd1c1deb176eaea9f29cbc4e3ee3ddda (diff)
downloadhostap-e49f535dc518f7609fbbe5ecff9966ad271cf3f2.zip
hostap-e49f535dc518f7609fbbe5ecff9966ad271cf3f2.tar.gz
hostap-e49f535dc518f7609fbbe5ecff9966ad271cf3f2.tar.bz2
FST: Fix Session Transition element length field value
The Element ID and Length subfields are not supposed to be included in the Length. In addition, both of these subfields needs to be filled in even for non-zero status code cases. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/fst')
-rw-r--r--src/fst/fst_session.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/fst/fst_session.c b/src/fst/fst_session.c
index 94122fd..ac49fcf 100644
--- a/src/fst/fst_session.c
+++ b/src/fst/fst_session.c
@@ -893,7 +893,7 @@ int fst_session_initiate_setup(struct fst_session *s)
req.llt = host_to_le32(FST_LLT_MS_TO_VAL(s->data.llt_ms));
/* 8.4.2.147 Session Transition element */
req.stie.element_id = WLAN_EID_SESSION_TRANSITION;
- req.stie.length = sizeof(req.stie);
+ req.stie.length = sizeof(req.stie) - 2;
req.stie.fsts_id = host_to_le32(fsts_id);
req.stie.session_control = SESSION_CONTROL(SESSION_TYPE_BSS, 0);
@@ -968,9 +968,10 @@ int fst_session_respond(struct fst_session *s, u8 status_code)
res.dialog_token = s->data.pending_setup_req_dlgt;
res.status_code = status_code;
+ res.stie.element_id = WLAN_EID_SESSION_TRANSITION;
+ res.stie.length = sizeof(res.stie) - 2;
+
if (status_code == WLAN_STATUS_SUCCESS) {
- res.stie.element_id = WLAN_EID_SESSION_TRANSITION;
- res.stie.length = sizeof(res.stie);
res.stie.fsts_id = s->data.fsts_id;
res.stie.session_control = SESSION_CONTROL(SESSION_TYPE_BSS, 0);
@@ -1374,7 +1375,7 @@ int fst_test_req_send_fst_request(const char *params)
req.llt = host_to_le32(FST_LLT_MS_DEFAULT);
/* 8.4.2.147 Session Transition element */
req.stie.element_id = WLAN_EID_SESSION_TRANSITION;
- req.stie.length = sizeof(req.stie);
+ req.stie.length = sizeof(req.stie) - 2;
req.stie.fsts_id = host_to_le32(fsts_id);
req.stie.session_control = SESSION_CONTROL(SESSION_TYPE_BSS, 0);
@@ -1443,9 +1444,10 @@ int fst_test_req_send_fst_response(const char *params)
_s->data.pending_setup_req_dlgt : g->dialog_token;
res.status_code = status_code;
+ res.stie.element_id = WLAN_EID_SESSION_TRANSITION;
+ res.stie.length = sizeof(res.stie) - 2;
+
if (res.status_code == WLAN_STATUS_SUCCESS) {
- res.stie.element_id = WLAN_EID_SESSION_TRANSITION;
- res.stie.length = sizeof(res.stie);
res.stie.fsts_id = fsts_id;
res.stie.session_control = SESSION_CONTROL(SESSION_TYPE_BSS, 0);