From ee084ab956271d7dddfe07e0bae31d99136d28d3 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Thu, 16 Apr 1998 22:11:46 +0000 Subject: [PATCH] Stop the idle timer if the timeout is disabled while the timer is active. --- usr.sbin/ppp/bundle.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 22a81aec85e..c0a7489b3ef 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.47 1998/04/16 00:25:49 brian Exp $ + * $Id: bundle.c,v 1.1.2.48 1998/04/16 21:19:05 brian Exp $ */ #include @@ -921,16 +921,17 @@ bundle_IdleTimeout(void *v) void bundle_StartIdleTimer(struct bundle *bundle) { - if (!(bundle->phys_type & (PHYS_DEDICATED|PHYS_PERM)) && - bundle->cfg.idle_timeout) { + if (!(bundle->phys_type & (PHYS_DEDICATED|PHYS_PERM))) { StopTimer(&bundle->idle.timer); - bundle->idle.timer.func = bundle_IdleTimeout; - bundle->idle.timer.name = "idle"; - bundle->idle.timer.load = bundle->cfg.idle_timeout * SECTICKS; - bundle->idle.timer.state = TIMER_STOPPED; - bundle->idle.timer.arg = bundle; - StartTimer(&bundle->idle.timer); - bundle->idle.done = time(NULL) + bundle->cfg.idle_timeout; + if (bundle->cfg.idle_timeout) { + bundle->idle.timer.func = bundle_IdleTimeout; + bundle->idle.timer.name = "idle"; + bundle->idle.timer.load = bundle->cfg.idle_timeout * SECTICKS; + bundle->idle.timer.state = TIMER_STOPPED; + bundle->idle.timer.arg = bundle; + StartTimer(&bundle->idle.timer); + bundle->idle.done = time(NULL) + bundle->cfg.idle_timeout; + } } }