Date: Sun, 20 Oct 2002 22:33:14 +0400 (MSD) From: Gleb Smirnoff <glebius@cell.sick.ru> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/44310: make ppp(8) add clients MAC address to all RADIUS requests and responces Message-ID: <200210201833.g9KIXEtF016470@cell.sick.ru>
next in thread | raw e-mail | index | archive | help
>Number: 44310
>Category: bin
>Synopsis: make ppp(8) add clients MAC address to all RADIUS requests and responces
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Oct 20 11:40:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Gleb Smirnoff
>Release: FreeBSD 4.7-PRERELEASE i386
>Organization:
Moscow State University
>Environment:
System: FreeBSD cell.sick.ru 4.7-PRERELEASE FreeBSD 4.7-PRERELEASE #7: Fri Sep 6 02:58:47 MSD 2002 root@cell.sick.ru:/usr/obj/usr/src/sys/NUCLEUS i386
>Description:
The following patch makes ppp(8) to add clients' MAC address to RADIUS
packet if it is serving PPPoE (is run from pppoed(8)). ppp(8) will write MAC
to RADIUS variable RAD_CALLING_STATION_ID. It can not be messed with real
station id's (which are phone numbers), because ppp(8) also adds
variable RAD_NAS_PORT_TYPE = RAD_ETHERNET.
>How-To-Repeat:
Without this it is impossible to determine from which machine
did the PPPoE client came from.
>Fix:
--- /usr/src/usr.sbin/ppp/radius.c Sun Sep 1 06:12:32 2002
+++ radius.c Sun Oct 20 22:10:27 2002
@@ -726,6 +726,7 @@
struct timeval tv;
int got;
char hostname[MAXHOSTNAMELEN];
+ char *mac_addr;
#if 0
struct hostent *hp;
struct in_addr hostaddr;
@@ -866,6 +867,13 @@
}
}
+ if ((mac_addr = getenv("HISMACADDR")) != 0)
+ if (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;
@@ -895,6 +903,7 @@
struct timeval tv;
int got;
char hostname[MAXHOSTNAMELEN];
+ char *mac_addr;
#if 0
struct hostent *hp;
struct in_addr hostaddr;
@@ -962,6 +971,13 @@
rad_close(r->cx.rad);
return;
}
+
+ if ((mac_addr = getenv("HISMACADDR")) != 0)
+ if (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));
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210201833.g9KIXEtF016470>
