summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2004-06-26 01:02:31 +0000
committerbrian <brian@FreeBSD.org>2004-06-26 01:02:31 +0000
commita9f3927ec8d21dcaf4867f5a4781d8d7e2ab27c0 (patch)
tree5e195451fe24b96c4ec6391aa8057f90eec8563c /usr.sbin
parentcd721672a01a90040c2f1e5af0a17840d6d8c529 (diff)
downloadFreeBSD-src-a9f3927ec8d21dcaf4867f5a4781d8d7e2ab27c0.zip
FreeBSD-src-a9f3927ec8d21dcaf4867f5a4781d8d7e2ab27c0.tar.gz
If HISMACADDR is set in the environment (by pppoed), pass the value to
the RADIUS server as RAD_CALLING_STATION_ID. PR: 44310 Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> MFC after: 2 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/radius.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/usr.sbin/ppp/radius.c b/usr.sbin/ppp/radius.c
index 06f716b..57ed21b 100644
--- a/usr.sbin/ppp/radius.c
+++ b/usr.sbin/ppp/radius.c
@@ -821,6 +821,7 @@ radius_Authenticate(struct radius *r, struct authinfo *authp, const char *name,
struct timeval tv;
int got;
char hostname[MAXHOSTNAMELEN];
+ char *mac_addr;
#if 0
struct hostent *hp;
struct in_addr hostaddr;
@@ -961,6 +962,13 @@ radius_Authenticate(struct radius *r, struct authinfo *authp, const char *name,
}
}
+ if ((mac_addr = getenv("HISMACADDR")) != NULL &&
+ rad_put_string(r->cx.rad, RAD_CALLING_STATION_ID, mac_addr) != 0) {
+ log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
+ rad_close(r->cx.rad);
+ return;
+ }
+
radius_put_physical_details(r->cx.rad, authp->physical);
r->cx.auth = authp;
@@ -1009,6 +1017,7 @@ radius_Account(struct radius *r, struct radacct *ac, struct datalink *dl,
struct timeval tv;
int got;
char hostname[MAXHOSTNAMELEN];
+ char *mac_addr;
#if 0
struct hostent *hp;
struct in_addr hostaddr;
@@ -1108,6 +1117,13 @@ radius_Account(struct radius *r, struct radacct *ac, struct datalink *dl,
break;
}
+ if ((mac_addr = getenv("HISMACADDR")) != NULL &&
+ rad_put_string(r->cx.rad, RAD_CALLING_STATION_ID, mac_addr) != 0) {
+ log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
+ rad_close(r->cx.rad);
+ return;
+ }
+
if (gethostname(hostname, sizeof hostname) != 0)
log_Printf(LogERROR, "rad_put: gethostname(): %s\n", strerror(errno));
else {
OpenPOWER on IntegriCloud