diff options
author | Can Erkin Acar <canacar@cvs.openbsd.org> | 2005-03-23 00:11:41 +0000 |
---|---|---|
committer | Can Erkin Acar <canacar@cvs.openbsd.org> | 2005-03-23 00:11:41 +0000 |
commit | b052eedd7f8ddbb303a633aa0e35746e2ede3095 (patch) | |
tree | 3d9734d38579270449cf7366673574a557ee2881 /sys/net/if_spppsubr.c | |
parent | 0206f5f1d234e1446107bbe937d0996a5768bdb2 (diff) |
Follow RFC and do not reset timeouts everytime sppp_cp_change_state()
is called. Makes two sppp instances to handshake against each other.
Tested by Greg Mortensen, ok claudio@
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r-- | sys/net/if_spppsubr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 9c103d6f500..263b18d98c1 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.26 2004/12/10 14:35:30 naddy Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.27 2005/03/23 00:11:40 canacar Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. * Keepalive protocol implemented in both Cisco and PPP modes. @@ -1844,20 +1844,21 @@ sppp_cp_change_state(const struct cp *cp, struct sppp *sp, int newstate) sppp_state_name(newstate)); sp->state[cp->protoidx] = newstate; - UNTIMEOUT(cp->TO, (void *)sp, sp->ch[cp->protoidx]); switch (newstate) { case STATE_INITIAL: case STATE_STARTING: case STATE_CLOSED: case STATE_STOPPED: case STATE_OPENED: + UNTIMEOUT(cp->TO, (void *)sp, sp->ch[cp->protoidx]); break; case STATE_CLOSING: case STATE_STOPPING: case STATE_REQ_SENT: case STATE_ACK_RCVD: case STATE_ACK_SENT: - sppp_increasing_timeout (cp, sp); + if (!timeout_pending(&sp->ch[cp->protoidx])) + sppp_increasing_timeout (cp, sp); break; } } |