aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_fast.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-02-28 01:56:30 (GMT)
committerJouni Malinen <j@w1.fi>2008-02-28 01:56:30 (GMT)
commita4819630f6da5ff611b53c1706d11a87658a2d6b (patch)
tree38cd493ad4d8b748441b7c2fab58d2aa851034cb /src/eap_peer/eap_fast.c
parent829f14be171f7e340394cba6084998753938452b (diff)
downloadhostap-a4819630f6da5ff611b53c1706d11a87658a2d6b.zip
hostap-a4819630f6da5ff611b53c1706d11a87658a2d6b.tar.gz
hostap-a4819630f6da5ff611b53c1706d11a87658a2d6b.tar.bz2
EAP-FAST: Added shared helper functions for building TLVs
Diffstat (limited to 'src/eap_peer/eap_fast.c')
-rw-r--r--src/eap_peer/eap_fast.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/eap_peer/eap_fast.c b/src/eap_peer/eap_fast.c
index caca89e..0d2e28c 100644
--- a/src/eap_peer/eap_fast.c
+++ b/src/eap_peer/eap_fast.c
@@ -599,24 +599,21 @@ static struct wpabuf * eap_fast_tlv_pac_ack(void)
static struct wpabuf * eap_fast_tlv_eap_payload(struct wpabuf *buf)
{
struct wpabuf *msg;
- struct eap_tlv_hdr *tlv;
if (buf == NULL)
return NULL;
/* Encapsulate EAP packet in EAP Payload TLV */
- msg = wpabuf_alloc(sizeof(*tlv) + wpabuf_len(buf));
+ msg = wpabuf_alloc(sizeof(struct pac_tlv_hdr) + wpabuf_len(buf));
if (msg == NULL) {
wpa_printf(MSG_DEBUG, "EAP-FAST: Failed to allocate memory "
"for TLV encapsulation");
wpabuf_free(buf);
return NULL;
}
- tlv = wpabuf_put(msg, sizeof(*tlv));
- tlv->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY |
- EAP_TLV_EAP_PAYLOAD_TLV);
- tlv->length = host_to_be16(wpabuf_len(buf));
- wpabuf_put_buf(msg, buf);
+ eap_fast_put_tlv_buf(msg,
+ EAP_TLV_TYPE_MANDATORY | EAP_TLV_EAP_PAYLOAD_TLV,
+ buf);
wpabuf_free(buf);
return msg;
}