diff options
author | brian <brian@cvs.openbsd.org> | 1998-01-20 22:46:33 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1998-01-20 22:46:33 +0000 |
commit | 3d2201a7982c109e8fc6c5a6a83083f7c0a26303 (patch) | |
tree | 2d37ccc60ab36afd94ca01e70d677e7fcb350e71 /usr.sbin/ppp/lcp.c | |
parent | 9c88dd386e8011d11f46ffbeec2a412dc2c9edc5 (diff) |
Allow an optional delay when specifying "set openmode active".
The delay defaults to 1 sec (as it always has) unless we've done
a ~p in interactive mode or we've actually detected a HDLC frame.
This is now cleanly implemented (via async timers) so that it is
possible for LCP to come up despite the delay if an LCP REQ is
received.
This will hopefully solve situations with slow servers or slirp
scenarios (where ECHO is left on the port for a second or so before
the peer enters packet mode).
Also, ~p in interactive mode no longer changes the value of the default
openmode delay and -dedicated mode enters packet mode in the right state
according to the value of openmode.
Diffstat (limited to 'usr.sbin/ppp/lcp.c')
-rw-r--r-- | usr.sbin/ppp/lcp.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c index 8b915de11f7..edefcd306b3 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.6 1998/01/11 17:55:19 brian Exp $ + * $Id: lcp.c,v 1.7 1998/01/20 22:46:26 brian Exp $ * * TODO: * o Validate magic number received from peer. @@ -120,12 +120,13 @@ struct fsm LcpFsm = { "LCP", /* Name of protocol */ PROTO_LCP, /* Protocol Number */ LCP_MAXCODE, - OPEN_ACTIVE, + 1, /* Open mode delay */ ST_INITIAL, /* State of machine */ 0, 0, 0, 0, - {0, 0, 0, NULL, NULL, NULL}, - {0, 0, 0, NULL, NULL, NULL}, + {0, 0, 0, NULL, NULL, NULL}, /* FSM timer */ + {0, 0, 0, NULL, NULL, NULL}, /* Open timer */ + {0, 0, 0, NULL, NULL, NULL}, /* Stopped timer */ LogLCP, LcpLayerUp, @@ -179,8 +180,11 @@ ReportLcpStatus(struct cmdargs const *arg) lcp->want_acfcomp, (u_long)lcp->want_magic, lcp->my_reject); fprintf(VarTerm, "\nDefaults: MRU = %d, ACCMAP = %08lx\t", VarMRU, (u_long)VarAccmap); - fprintf(VarTerm, "Open Mode: %s\n", - (VarOpenMode == OPEN_ACTIVE) ? "active" : "passive"); + fprintf(VarTerm, "Open Mode: %s", + (VarOpenMode == OPEN_PASSIVE) ? "passive" : "active"); + if (VarOpenMode > 0) + fprintf(VarTerm, " (delay %d)", VarOpenMode); + fputc('\n', VarTerm); return 0; } |