path: root/src/ap/accounting.c
diff options
authorJouni Malinen <j@w1.fi>2016-02-29 15:40:23 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-29 15:43:13 (GMT)
commitdebde14b5b360537d51362b7cdc3b5cc02cf1945 (patch)
treeccbd0c41fdf90a6e85f5a81743b4db3fe83dd0ff /src/ap/accounting.c
parent9961c70a852305aed8a870d07ee22d302ea0a2b5 (diff)
RADIUS: Add Acct-Delay-Time into accounting messages
This tells to the server how long we have been trying to transmit the message so that the actual time of the message generation can be determined from receive time (ignoring network delays and only at accuracy of one second). For interim updates, only value 0 is used since there are no retransmissions of the same message. For other accounting messages, the initial attempt goes out with value 0 and the retransmissions, if needed, show the number of seconds the message has been waiting in the queue. Update the Identifier and Authenticator in the messages whenever updating the Acct-Delay-Time per RFC 2866, 4.1 requirements. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/ap/accounting.c')
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ap/accounting.c b/src/ap/accounting.c
index 010ba05..854174e 100644
--- a/src/ap/accounting.c
+++ b/src/ap/accounting.c
@@ -152,6 +152,15 @@ static struct radius_msg * accounting_msg(struct hostapd_data *hapd,
goto fail;
+ /*
+ * Add Acct-Delay-Time with zero value for the first transmission. This
+ * will be updated within radius_client.c when retransmitting the frame.
+ */
+ if (!radius_msg_add_attr_int32(msg, RADIUS_ATTR_ACCT_DELAY_TIME, 0)) {
+ wpa_printf(MSG_INFO, "Could not add Acct-Delay-Time");
+ goto fail;
+ }
return msg;