From 7b4a34f6fcc4fec9c6dd02f4d2c8480906d3b365 Mon Sep 17 00:00:00 2001 From: z3APA3A <3APA3A@3proxy.ru> Date: Wed, 21 Dec 2016 00:30:05 +0300 Subject: [PATCH] Support for Framed-IP-Address / Framed-IPv6-Address in RADIUS server's reply --- src/authradius.c | 16 ++++++++++++++-- src/version.h | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/authradius.c b/src/authradius.c index c11e089..c82c682 100644 --- a/src/authradius.c +++ b/src/authradius.c @@ -632,10 +632,22 @@ int radauth(struct clientparam * param){ continue; } - if (!vendor && attr[0] == PW_REPLY_MESSAGE) { + else if (!vendor && attr[0] == PW_REPLY_MESSAGE) { memcpy(buf, attr+2, attr[1]-2); buf[attr[1]-2]=0; } + + else if (!vendor && attr[0] == PW_FRAMED_IP_ADDRESS && attr[1] == 6) { + *SAFAMILY(¶m->sinsl) = AF_INET; + memcpy(SAADDR(¶m->sinsl), attr+2, 4); + } + + else if (!vendor && attr[0] == PW_FRAMED_IPV6_ADDRESS && attr[1] == 18) { + *SAFAMILY(¶m->sinsl) = AF_INET6; + memcpy(SAADDR(¶m->sinsl), attr+2, 16); + } + + /* else if (vendor == SANDY && attr[0] == SANDY_MAIL_MAILBOX) { memcpy (p->drop_name, attr + 2, attr[1] - 2); @@ -675,4 +687,4 @@ CLEANRET: return res; } -#endif \ No newline at end of file +#endif diff --git a/src/version.h b/src/version.h index 4426d32..70b13f2 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ #define VERSION "3proxy-0.9-devel" -#define BUILDDATE "160518000524" +#define BUILDDATE "161220233959"