summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2014-03-22 04:21:05 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2014-03-22 04:21:05 +0000
commitb85b88d6b1a5d3332d844dae445d06a5a22c84df (patch)
tree5efc40a28fb1751a73b4b81a39b4c4b60a582ee2
parent2f5a1c95114612275554e397725a9fa09ff82868 (diff)
In RADIUS accounting, realm_framed_ip_address was mistakenly used for
Framed-IP-Address. acct_framed_ip_address should be used for that purpose.
-rw-r--r--usr.sbin/npppd/npppd/npppd.c6
-rw-r--r--usr.sbin/npppd/npppd/npppd_radius.c9
2 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/npppd/npppd/npppd.c b/usr.sbin/npppd/npppd/npppd.c
index 65456a32d8c..3768adc30f8 100644
--- a/usr.sbin/npppd/npppd/npppd.c
+++ b/usr.sbin/npppd/npppd/npppd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: npppd.c,v 1.32 2013/09/13 03:25:28 yasuoka Exp $ */
+/* $OpenBSD: npppd.c,v 1.33 2014/03/22 04:21:04 yasuoka Exp $ */
/*-
* Copyright (c) 2005-2008,2009 Internet Initiative Japan Inc.
@@ -29,7 +29,7 @@
* Next pppd(nppd). This file provides a npppd daemon process and operations
* for npppd instance.
* @author Yasuoka Masahiko
- * $Id: npppd.c,v 1.32 2013/09/13 03:25:28 yasuoka Exp $
+ * $Id: npppd.c,v 1.33 2014/03/22 04:21:04 yasuoka Exp $
*/
#include "version.h"
#include <sys/types.h>
@@ -1559,6 +1559,7 @@ npppd_assign_ip_addr(npppd *_this, npppd_ppp *ppp, uint32_t req_ip4)
ppp->ppp_framed_ip_address.s_addr = htonl(ip4);
ppp->ppp_framed_ip_netmask.s_addr = htonl(ip4mask);
+ ppp->acct_framed_ip_address = ppp->ppp_framed_ip_address;
} else {
dyna_assign:
pool = ppp_pool(ppp);
@@ -1572,6 +1573,7 @@ dyna_assign:
ppp->assign_dynapool = 1;
ppp->ppp_framed_ip_address.s_addr = htonl(ip4);
ppp->ppp_framed_ip_netmask.s_addr = htonl(0xffffffffL);
+ ppp->acct_framed_ip_address = ppp->ppp_framed_ip_address;
}
return npppd_pool_assign_ip(ppp->assigned_pool, ppp);
diff --git a/usr.sbin/npppd/npppd/npppd_radius.c b/usr.sbin/npppd/npppd/npppd_radius.c
index a405862de9f..dd9c303c959 100644
--- a/usr.sbin/npppd/npppd/npppd_radius.c
+++ b/usr.sbin/npppd/npppd/npppd_radius.c
@@ -1,4 +1,4 @@
-/* $Id: npppd_radius.c,v 1.5 2012/09/18 13:14:08 yasuoka Exp $ */
+/* $Id: npppd_radius.c,v 1.6 2014/03/22 04:21:04 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* All rights reserved.
@@ -247,12 +247,9 @@ radius_acct_request(npppd *pppd, npppd_ppp *ppp, int stop)
ATTR_INT32(RADIUS_TYPE_FRAMED_PROTOCOL, RADIUS_FRAMED_PROTOCOL_PPP);
/* RFC 2865 "5.8. Framed-IP-Address" */
- if (ppp_ip_assigned(ppp) && !stop)
- ppp->realm_framed_ip_address = ppp->ppp_framed_ip_address;
- if (ppp->realm_framed_ip_address.s_addr != INADDR_ANY) {
+ if (ppp->acct_framed_ip_address.s_addr != INADDR_ANY)
ATTR_INT32(RADIUS_TYPE_FRAMED_IP_ADDRESS,
- ntohl(ppp->realm_framed_ip_address.s_addr));
- }
+ ntohl(ppp->acct_framed_ip_address.s_addr));
/* Accounting */
/* RFC 2866 5.1. Acct-Status-Type */