From 251a91d6b4160cda12cd0d34a44c0c4e09cff02d Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Sat, 21 Nov 2026 14:07:10 +0300 Subject: [PATCH] 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. --- man/3proxy.cfg.5 | 3 ++- src/authradius.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/man/3proxy.cfg.5 b/man/3proxy.cfg.5 index 042bab5..cce22fe 100644 --- a/man/3proxy.cfg.5 +++ b/man/3proxy.cfg.5 @@ -600,7 +600,8 @@ Framed-IPv6-Address / Framed-IP-Address: (IP address of the client), Called-Station-ID: (requested Hostname, if presents), Login-Service: (type of request, e.g. 1001 - SOCKS CONNECT, 1010 - HTTP GET, 1013 - HTTP CONNECT), 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 Supported reply attributes for authentication: Framed-IP-Address / Framed-IPv6-Address (IP to assign to user), Reply-Message. diff --git a/src/authradius.c b/src/authradius.c index 8b2390c..60aea98 100644 --- a/src/authradius.c +++ b/src/authradius.c @@ -349,6 +349,13 @@ int radsend(struct clientparam * param, int auth, int stop){ ptr+=len; 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 */ *ptr++ = PW_NAS_PORT_TYPE; *ptr++ = 6;