diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2010-09-24 02:57:44 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2010-09-24 02:57:44 +0000 |
commit | f797683e2f88c85501a52845548268326e3f2403 (patch) | |
tree | 02d267d160ad7ecc6a2b1227edceb5e2546c5462 /usr.sbin | |
parent | 3a415971e51236a8822966e9478dec1e2a4fc992 (diff) |
npppd didn't setup a PIPEX session if MPPE is not required by config and
CCP is failed to be opened because the peer doesn't support MPPE. Fixed to
setup a PIPEX on such case.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/npppd/npppd/ccp.c | 7 | ||||
-rw-r--r-- | usr.sbin/npppd/npppd/ppp.c | 18 | ||||
-rw-r--r-- | usr.sbin/npppd/npppd/ppp.h | 3 |
3 files changed, 20 insertions, 8 deletions
diff --git a/usr.sbin/npppd/npppd/ccp.c b/usr.sbin/npppd/npppd/ccp.c index bfe283bd6b3..9364e658b4a 100644 --- a/usr.sbin/npppd/npppd/ccp.c +++ b/usr.sbin/npppd/npppd/ccp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ccp.c,v 1.3 2010/07/02 21:20:57 yasuoka Exp $ */ +/* $OpenBSD: ccp.c,v 1.4 2010/09/24 02:57:43 yasuoka Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -28,7 +28,7 @@ /**@file * This file provides functions for CCP (Compression Control Protocol). * MPPE is supported as a CCP option. - * $Id: ccp.c,v 1.3 2010/07/02 21:20:57 yasuoka Exp $ + * $Id: ccp.c,v 1.4 2010/09/24 02:57:43 yasuoka Exp $ */ #include <sys/types.h> #include <sys/socket.h> @@ -216,8 +216,7 @@ ccp_stop(fsm *f) { #ifdef USE_NPPPD_MPPE fsm_log(f, LOG_INFO, "CCP is stopped"); - if (f->ppp->mppe.required) - ppp_stop(f->ppp, NULL); + ppp_ccp_stopped(f->ppp); #endif } diff --git a/usr.sbin/npppd/npppd/ppp.c b/usr.sbin/npppd/npppd/ppp.c index 69da34d5dee..14a44a9b3c4 100644 --- a/usr.sbin/npppd/npppd/ppp.c +++ b/usr.sbin/npppd/npppd/ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp.c,v 1.5 2010/07/31 09:33:09 yasuoka Exp $ */ +/* $OpenBSD: ppp.c,v 1.6 2010/09/24 02:57:43 yasuoka Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* $Id: ppp.c,v 1.5 2010/07/31 09:33:09 yasuoka Exp $ */ +/* $Id: ppp.c,v 1.6 2010/09/24 02:57:43 yasuoka Exp $ */ /**@file * This file provides PPP(Point-to-Point Protocol, RFC 1661) and * {@link :: _npppd_ppp PPP instance} related functions. @@ -671,6 +671,17 @@ ppp_ccp_opened(npppd_ppp *_this) #endif } +void +ppp_ccp_stopped(npppd_ppp *_this) +{ + if (_this->mppe.required) + ppp_stop(_this, NULL); +#ifdef USE_NPPPD_PIPEX + else + ppp_on_network_pipex(_this); +#endif +} + /************************************************************************ * Network I/O related functions ************************************************************************/ @@ -1076,7 +1087,8 @@ ppp_on_network_pipex(npppd_ppp *_this) return; /* already started */ if (_this->assigned_ip4_enabled != 0 && - (!MPPE_MUST_NEGO(_this) || _this->ccp.fsm.state == OPENED)) { + (!MPPE_MUST_NEGO(_this) || _this->ccp.fsm.state == OPENED || + _this->ccp.fsm.state == STOPPED)) { /* IPCP is opened and MPPE is not required or MPPE is opened */ npppd_ppp_pipex_enable(_this->pppd, _this); ppp_log(_this, LOG_NOTICE, "Using pipex=%s", diff --git a/usr.sbin/npppd/npppd/ppp.h b/usr.sbin/npppd/npppd/ppp.h index 53ea82fb0cf..3f8658ba7ff 100644 --- a/usr.sbin/npppd/npppd/ppp.h +++ b/usr.sbin/npppd/npppd/ppp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp.h,v 1.4 2010/07/31 09:33:09 yasuoka Exp $ */ +/* $OpenBSD: ppp.h,v 1.5 2010/09/24 02:57:43 yasuoka Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -755,6 +755,7 @@ void ppp_phy_downed (npppd_ppp *); void ppp_auth_ok (npppd_ppp *); void ppp_ipcp_opened (npppd_ppp *); void ppp_ccp_opened (npppd_ppp *); +void ppp_ccp_stopped (npppd_ppp *); inline void ppp_output (npppd_ppp *, uint16_t, u_char, u_char, u_char *, int); u_char *ppp_packetbuf (npppd_ppp *, int); const char *ppp_config_str (npppd_ppp *, const char *); |