TNC: Fix EAP-TNC fragmentation of the last message

62477841a1 tried to address fragmentation
issues, but it did not address the case where the final EAP-TNC
message gets fragmented. Move the state update to the correct place
to address this case, too.
This commit is contained in:
Jouni Malinen 2010-04-18 12:21:56 +03:00
parent 5febb0d272
commit 11804a4ebc

View File

@ -229,6 +229,10 @@ static struct wpabuf * eap_tnc_build_msg(struct eap_tnc_data *data, u8 id)
wpabuf_free(data->out_buf); wpabuf_free(data->out_buf);
data->out_buf = NULL; data->out_buf = NULL;
data->out_used = 0; data->out_used = 0;
if (data->was_fail)
data->state = FAIL;
else if (data->was_done)
data->state = DONE;
} else { } else {
wpa_printf(MSG_DEBUG, "EAP-TNC: Sending out %lu bytes " wpa_printf(MSG_DEBUG, "EAP-TNC: Sending out %lu bytes "
"(%lu more to send)", (unsigned long) send_len, "(%lu more to send)", (unsigned long) send_len,
@ -467,12 +471,7 @@ static void eap_tnc_process(struct eap_sm *sm, void *priv,
return; return;
} }
wpa_printf(MSG_DEBUG, "EAP-TNC: Fragment acknowledged"); wpa_printf(MSG_DEBUG, "EAP-TNC: Fragment acknowledged");
if (data->was_fail) data->state = CONTINUE;
data->state = FAIL;
else if (data->was_done)
data->state = DONE;
else
data->state = CONTINUE;
return; return;
} }