Fixed EAP-FAST peer not to add double Result TLV when ACKing PAC
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 2 Oct 2008 14:38:13 +0000 (17:38 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 2 Oct 2008 14:38:13 +0000 (17:38 +0300)
src/eap_peer/eap_fast.c

index 5bc1de0..8559ea8 100644 (file)
@@ -506,6 +506,8 @@ static struct wpabuf * eap_fast_tlv_result(int status, int intermediate)
        buf = wpabuf_alloc(sizeof(*result));
        if (buf == NULL)
                return NULL;
+       wpa_printf(MSG_DEBUG, "EAP-FAST: Add %sResult TLV(status=%d)",
+                  intermediate ? "Intermediate " : "", status);
        result = wpabuf_put(buf, sizeof(*result));
        result->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY |
                                        (intermediate ?
@@ -527,12 +529,7 @@ static struct wpabuf * eap_fast_tlv_pac_ack(void)
        if (buf == NULL)
                return NULL;
 
-       res = wpabuf_put(buf, sizeof(*res));
-       res->tlv_type = host_to_be16(EAP_TLV_RESULT_TLV |
-                                    EAP_TLV_TYPE_MANDATORY);
-       res->length = host_to_be16(sizeof(*res) - sizeof(struct eap_tlv_hdr));
-       res->status = host_to_be16(EAP_TLV_RESULT_SUCCESS);
-
+       wpa_printf(MSG_DEBUG, "EAP-FAST: Add PAC TLV (ack)");
        ack = wpabuf_put(buf, sizeof(*ack));
        ack->tlv_type = host_to_be16(EAP_TLV_PAC_TLV |
                                     EAP_TLV_TYPE_MANDATORY);