diff options
author | 2013-04-16 07:42:27 +0000 | |
---|---|---|
committer | 2013-04-16 07:42:27 +0000 | |
commit | e43db91efc22e4f6c105f5341a95ac3d4df669b8 (patch) | |
tree | be61210ff50b05f780c34fd887cccb2f0232a390 | |
parent | When pipex session is terminated by idle timer, there was a problem that (diff) | |
download | wireguard-openbsd-e43db91efc22e4f6c105f5341a95ac3d4df669b8.tar.xz wireguard-openbsd-e43db91efc22e4f6c105f5341a95ac3d4df669b8.zip |
Fixed `max-session' and `user-max-session'. They has been broken by the
configuration reworking.
-rw-r--r-- | usr.sbin/npppd/npppd/npppd.c | 13 | ||||
-rw-r--r-- | usr.sbin/npppd/npppd/npppd_local.h | 4 |
2 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/npppd/npppd/npppd.c b/usr.sbin/npppd/npppd/npppd.c index 7023d0452ed..87396b78e7e 100644 --- a/usr.sbin/npppd/npppd/npppd.c +++ b/usr.sbin/npppd/npppd/npppd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npppd.c,v 1.27 2013/02/13 22:10:38 yasuoka Exp $ */ +/* $OpenBSD: npppd.c,v 1.28 2013/04/16 07:42:27 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.27 2013/02/13 22:10:38 yasuoka Exp $ + * $Id: npppd.c,v 1.28 2013/04/16 07:42:27 yasuoka Exp $ */ #include "version.h" #include <sys/types.h> @@ -784,7 +784,7 @@ npppd_check_user_max_session(npppd *_this, npppd_ppp *ppp) slist *uppp; /* user_max_session == 0 means unlimit */ - if (_this->user_max_session == 0) + if (_this->conf.user_max_session == 0) return 1; count = 0; @@ -797,7 +797,7 @@ npppd_check_user_max_session(npppd *_this, npppd_ppp *ppp) } } - return (count < _this->user_max_session)? 1 : 0; + return (count < _this->conf.user_max_session)? 1 : 0; } /*********************************************************************** @@ -2108,10 +2108,11 @@ npppd_ppp_bind_iface(npppd *_this, npppd_ppp *ppp) if (ifidx < 0) return 1; - if (_this->max_session > 0 && _this->nsession++ >= _this->max_session) { + if (_this->conf.max_session > 0 && + _this->nsession++ >= _this->conf.max_session) { ppp_log(ppp, LOG_WARNING, "Number of sessions reaches out of the limit=%d", - _this->max_session); + _this->conf.max_session); return 1; } ppp->ifidx = ifidx; diff --git a/usr.sbin/npppd/npppd/npppd_local.h b/usr.sbin/npppd/npppd/npppd_local.h index 366b22e082c..2e15a8be0fc 100644 --- a/usr.sbin/npppd/npppd/npppd_local.h +++ b/usr.sbin/npppd/npppd/npppd_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: npppd_local.h,v 1.11 2012/09/18 13:14:08 yasuoka Exp $ */ +/* $OpenBSD: npppd_local.h,v 1.12 2013/04/16 07:42:27 yasuoka Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -170,8 +170,6 @@ struct _npppd { int16_t reloading_count; int nsession; - int user_max_session; - int max_session; u_int /** whether finalizing or not */ finalizing:1, |