From 7729a18215d1dd3de8aef226105f2c83dcedbb16 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Tue, 16 Jun 1998 07:15:16 +0000 Subject: [PATCH] Only set the datalink::stayonline flag if we close/down with CLOSE_LCP when our state is DATALINK_READY or higher. --- usr.sbin/ppp/datalink.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c index 8ec49d41b058..b266c9e8da39 100644 --- a/usr.sbin/ppp/datalink.c +++ b/usr.sbin/ppp/datalink.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: datalink.c,v 1.8 1998/06/12 17:45:09 brian Exp $ + * $Id: datalink.c,v 1.9 1998/06/15 19:05:15 brian Exp $ */ #include @@ -394,11 +394,11 @@ datalink_ComeDown(struct datalink *dl, int how) if (how != CLOSE_NORMAL) { dl->dial_tries = -1; dl->reconnect_tries = 0; - if (how == CLOSE_LCP) + if (dl->state >= DATALINK_READY && how == CLOSE_LCP) dl->stayonline = 1; } - if (dl->stayonline) { + if (dl->state >= DATALINK_READY && dl->stayonline) { dl->stayonline = 0; datalink_NewState(dl, DATALINK_READY); } else if (dl->state != DATALINK_CLOSED && dl->state != DATALINK_HANGUP) { @@ -796,7 +796,8 @@ datalink_StayDown(struct datalink *dl) void datalink_DontHangup(struct datalink *dl) { - dl->stayonline = 1; + if (dl->state >= DATALINK_LCP) + dl->stayonline = 1; } int