From owner-freebsd-bugs Sun Oct 20 11:40: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD85937B401 for ; Sun, 20 Oct 2002 11:40:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E094043E88 for ; Sun, 20 Oct 2002 11:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9KIe1x3078544 for ; Sun, 20 Oct 2002 11:40:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9KIe1gn078543; Sun, 20 Oct 2002 11:40:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C46D37B401 for ; Sun, 20 Oct 2002 11:33:22 -0700 (PDT) Received: from cell.sick.ru (cell.sick.ru [195.91.162.238]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3F2F43E4A for ; Sun, 20 Oct 2002 11:33:21 -0700 (PDT) (envelope-from glebius@cell.sick.ru) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.6/8.12.6) with ESMTP id g9KIXFns016471 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 20 Oct 2002 22:33:16 +0400 (MSD) (envelope-from glebius@cell.sick.ru) Received: (from glebius@localhost) by cell.sick.ru (8.12.6/8.12.6/Submit) id g9KIXEtF016470; Sun, 20 Oct 2002 22:33:14 +0400 (MSD) Message-Id: <200210201833.g9KIXEtF016470@cell.sick.ru> Date: Sun, 20 Oct 2002 22:33:14 +0400 (MSD) From: Gleb Smirnoff To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/44310: make ppp(8) add clients MAC address to all RADIUS requests and responces Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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