summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ppp/ppp/radius.c12
-rw-r--r--usr.sbin/ppp/ppp/radlib.h4
2 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/ppp/ppp/radius.c b/usr.sbin/ppp/ppp/radius.c
index 43093f153d1..a8d833706f4 100644
--- a/usr.sbin/ppp/ppp/radius.c
+++ b/usr.sbin/ppp/ppp/radius.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: radius.c,v 1.30 2005/09/21 02:07:25 brad Exp $
+ * $OpenBSD: radius.c,v 1.31 2005/09/21 13:44:55 brad Exp $
*
*/
@@ -94,6 +94,10 @@
#include "bundle.h"
#include "proto.h"
+#if !defined(UINT32_MAX)
+#define UINT32_MAX 0xffffffffU
+#endif
+
#ifndef NODES
struct mschap_response {
u_char ident;
@@ -1147,9 +1151,11 @@ radius_Account(struct radius *r, struct radacct *ac, struct datalink *dl,
if (acct_type == RAD_STOP)
/* Show some statistics */
- if (rad_put_int(r->cx.rad, RAD_ACCT_INPUT_OCTETS, stats->OctetsIn) != 0 ||
+ if (rad_put_int(r->cx.rad, RAD_ACCT_INPUT_OCTETS, stats->OctetsIn % UINT32_MAX) != 0 ||
+ rad_put_int(r->cx.rad, RAD_ACCT_INPUT_GIGAWORDS, stats->OctetsIn / UINT32_MAX) != 0 ||
rad_put_int(r->cx.rad, RAD_ACCT_INPUT_PACKETS, stats->PacketsIn) != 0 ||
- rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_OCTETS, stats->OctetsOut) != 0 ||
+ rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_OCTETS, stats->OctetsOut % UINT32_MAX) != 0 ||
+ rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_GIGAWORDS, stats->OctetsOut / UINT32_MAX) != 0 ||
rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_PACKETS, stats->PacketsOut)
!= 0 ||
rad_put_int(r->cx.rad, RAD_ACCT_SESSION_TIME, throughput_uptime(stats))
diff --git a/usr.sbin/ppp/ppp/radlib.h b/usr.sbin/ppp/ppp/radlib.h
index 7de24383565..2a4442cd3cd 100644
--- a/usr.sbin/ppp/ppp/radlib.h
+++ b/usr.sbin/ppp/ppp/radlib.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: radlib.h,v 1.5 2005/09/21 00:50:56 brad Exp $
+ * $OpenBSD: radlib.h,v 1.6 2005/09/21 13:44:55 brad Exp $
*/
#ifndef _RADLIB_H_
@@ -98,6 +98,8 @@
#define RAD_FRAMED_APPLETALK_NETWORK 38 /* Integer */
#define RAD_FRAMED_APPLETALK_ZONE 39 /* Integer */
/* reserved for accounting 40-59 */
+#define RAD_ACCT_INPUT_GIGAWORDS 52
+#define RAD_ACCT_OUTPUT_GIGAWORDS 53
#define RAD_CHAP_CHALLENGE 60 /* String */
#define RAD_NAS_PORT_TYPE 61 /* Integer */
#define RAD_ASYNC 0