diff options
author | Jouni Malinen <j@w1.fi> | 2012-06-17 19:35:03 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-06-17 19:35:03 +0300 |
commit | ff7e4589ea9cf5f2b09b3029d0ab00dd12301748 (patch) | |
tree | 9b09373ab96519ebf0b734850f426b4561efb98a /src | |
parent | 8047a958099516f570eca35dc6f3885a5809633a (diff) | |
download | external_wpa_supplicant_8_ti-ff7e4589ea9cf5f2b09b3029d0ab00dd12301748.zip external_wpa_supplicant_8_ti-ff7e4589ea9cf5f2b09b3029d0ab00dd12301748.tar.gz external_wpa_supplicant_8_ti-ff7e4589ea9cf5f2b09b3029d0ab00dd12301748.tar.bz2 |
RADIUS DAS: Add Event-Timestamp attribute into ACK/NAK messages
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r-- | src/radius/radius_das.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/radius/radius_das.c b/src/radius/radius_das.c index 61e3518..a9fcb69 100644 --- a/src/radius/radius_das.c +++ b/src/radius/radius_das.c @@ -149,6 +149,7 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx) struct wpabuf *rbuf; u32 val; int res; + struct os_time now; fromlen = sizeof(from); len = recvfrom(sock, buf, sizeof(buf), 0, @@ -185,13 +186,11 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx) goto fail; } + os_get_time(&now); res = radius_msg_get_attr(msg, RADIUS_ATTR_EVENT_TIMESTAMP, (u8 *) &val, 4); if (res == 4) { u32 timestamp = ntohl(val); - struct os_time now; - - os_get_time(&now); if (abs(now.sec - timestamp) > das->time_window) { wpa_printf(MSG_DEBUG, "DAS: Unacceptable " "Event-Timestamp (%u; local time %u) in " @@ -231,6 +230,13 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx) if (reply) { wpa_printf(MSG_DEBUG, "DAS: Reply to %s:%d", abuf, from_port); + if (!radius_msg_add_attr_int32(reply, + RADIUS_ATTR_EVENT_TIMESTAMP, + now.sec)) { + wpa_printf(MSG_DEBUG, "DAS: Failed to add " + "Event-Timestamp attribute"); + } + if (radius_msg_finish_das_resp(reply, das->shared_secret, das->shared_secret_len, hdr) < 0) { |