radius: the time of the request sent in it (#966)

Every request to a RADIUS server carries an Event-Timestamp (RFC 2869,
attribute 55), the time it was made in seconds since the epoch, so a
server no longer has to fish the time out of Acct-Session-Id.
This commit is contained in:
Vladimir Dubrovin committed 2026-11-21 14:07:12 +03:00
1 parent da9d1ba892
commit 62b6355040
2 files changed
+9 -1

No files matched your search

+2 -1
View File
@@ -619,7 +619,8 @@ Framed-IPv6-Address / Framed-IP-Address: (IP address of the client),
Called-Station-ID: (requested Hostname, if presents), Called-Station-ID: (requested Hostname, if presents),
Login-Service: (type of request, e.g. 1001 - SOCKS CONNECT, 1010 - HTTP GET, 1013 - HTTP CONNECT), Login-Service: (type of request, e.g. 1001 - SOCKS CONNECT, 1010 - HTTP GET, 1013 - HTTP CONNECT),
Login-TCP-Port: (requested port), Login-TCP-Port: (requested port),
Login-IPv6-Host / Login-IP-Host: (requested IP). Login-IPv6-Host / Login-IP-Host: (requested IP),
Event-Timestamp: (the time of the request, in seconds since the epoch).
.br .br
Supported reply attributes for authentication: Supported reply attributes for authentication:
Framed-IP-Address / Framed-IPv6-Address (IP to assign to user), Reply-Message. Framed-IP-Address / Framed-IPv6-Address (IP to assign to user), Reply-Message.
+7
View File
@@ -347,6 +347,13 @@ int radsend(struct clientparam * param, int auth, int stop){
ptr+=len; ptr+=len;
total_length+=len+2; total_length+=len+2;
/* Event-Timestamp */
*ptr++ = PW_EVENT_TIMESTAMP;
*ptr++ = 6;
(*(uint32_t *)ptr)=htonl((uint32_t)time(0));
ptr+=4;
total_length+=6;
/* NAS-Port-Type */ /* NAS-Port-Type */
*ptr++ = PW_NAS_PORT_TYPE; *ptr++ = PW_NAS_PORT_TYPE;
*ptr++ = 6; *ptr++ = 6;