From d2fd8d772fc2c515202fc665de28b8b571ae4793 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Mon, 2 Mar 1998 17:25:30 +0000 Subject: [PATCH] Force IPCP back to initial in bundle_Close(). Add a few un-necessary includes to make us build under 2.2.5. These'll go when the code is cleaned up at the end. --- usr.sbin/ppp/bundle.c | 13 +++++++++---- usr.sbin/ppp/ip.c | 3 ++- usr.sbin/ppp/lcp.c | 3 ++- usr.sbin/ppp/tun.c | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 8cead9daddf..f92453ac913 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.c,v 1.1.2.17 1998/02/27 01:22:16 brian Exp $ + * $Id: bundle.c,v 1.1.2.18 1998/03/01 01:07:39 brian Exp $ */ #include @@ -174,7 +174,7 @@ bundle_LayerStart(void *v, struct fsm *fp) /* The given FSM is about to start up ! */ struct bundle *bundle = (struct bundle *)v; - if (fp == &LcpInfo.fsm) + if (fp->proto == PROTO_LCP && bundle->phase == PHASE_DEAD) bundle_NewPhase(bundle, link2physical(fp->link), PHASE_ESTABLISH); } @@ -226,7 +226,7 @@ bundle_LayerFinish(void *v, struct fsm *fp) struct bundle *bundle = (struct bundle *)v; - if (fp == &LcpInfo.fsm) { + if (fp->proto == PROTO_LCP) { FsmDown(&IpcpInfo.fsm); /* You've lost your underlings */ FsmClose(&IpcpInfo.fsm); /* ST_INITIAL please */ } else if (fp == &IpcpInfo.fsm) { @@ -268,9 +268,14 @@ bundle_Close(struct bundle *bundle, const char *name, int staydown) if (staydown) for (dl = bundle->links; dl; dl = dl->next) datalink_StayDown(dl); - } else + } else { + if (IpcpInfo.fsm.state > ST_INITIAL) { + FsmClose(&IpcpInfo.fsm); + FsmDown(&IpcpInfo.fsm); + } for (dl = bundle->links; dl; dl = dl->next) datalink_Close(dl, staydown); + } } /* diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c index fe755e9970d..102f5aff402 100644 --- a/usr.sbin/ppp/ip.c +++ b/usr.sbin/ppp/ip.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: ip.c,v 1.38.2.7 1998/02/16 00:00:11 brian Exp $ + * $Id: ip.c,v 1.38.2.8 1998/02/23 00:38:32 brian Exp $ * * TODO: * o Return ICMP message for filterd packet @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c index f98a05a0713..3ac37e8de8a 100644 --- a/usr.sbin/ppp/lcp.c +++ b/usr.sbin/ppp/lcp.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: lcp.c,v 1.55.2.22 1998/02/27 21:46:26 brian Exp $ + * $Id: lcp.c,v 1.55.2.23 1998/03/01 01:07:45 brian Exp $ * * TODO: * o Limit data field length by MRU @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/usr.sbin/ppp/tun.c b/usr.sbin/ppp/tun.c index bcd966973c8..58f93eae207 100644 --- a/usr.sbin/ppp/tun.c +++ b/usr.sbin/ppp/tun.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tun.c,v 1.6.4.2 1998/02/18 19:35:59 brian Exp $ + * $Id: tun.c,v 1.6.4.3 1998/02/27 01:22:39 brian Exp $ */ #include @@ -31,6 +31,7 @@ #include #include #include +#include #include #include