mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
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
This commit is contained in:
parent
dae4042053
commit
5de776b9ac
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131122
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user