From 8b1bec90660314c59c7223312b085bd8da4a8077 Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 25 Mar 2001 09:59:23 +0000 Subject: (MFC candidate since this is already a merge from /sys/net only.) Merge rev's 1.65 and 1.66 from sys/net/if_spppsubr.c (implement the `restart' option, and fix a blatant bug with PAP authentication). The i4b implementation of this file should be merged back, but for now, we need this here as well. Reviewed by: gj --- sys/i4b/driver/i4b_ispppsubr.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/i4b/driver/i4b_ispppsubr.c b/sys/i4b/driver/i4b_ispppsubr.c index 7da2ea7..3e47912 100644 --- a/sys/i4b/driver/i4b_ispppsubr.c +++ b/sys/i4b/driver/i4b_ispppsubr.c @@ -1872,6 +1872,20 @@ sppp_open_event(const struct cp *cp, struct sppp *sp) sppp_cp_change_state(cp, sp, STATE_REQ_SENT); break; case STATE_STOPPED: + /* + * Try escaping stopped state. This seems to bite + * people occasionally, in particular for IPCP, + * presumably following previous IPCP negotiation + * aborts. Somehow, we must have missed a Down event + * which would have caused a transition into starting + * state, so as a bandaid we force the Down event now. + * This effectively implements (something like the) + * `restart' option mentioned in the state transition + * table of RFC 1661. + */ + sppp_cp_change_state(cp, sp, STATE_STARTING); + (cp->tls)(sp); + break; case STATE_STOPPING: case STATE_REQ_SENT: case STATE_ACK_RCVD: @@ -3774,8 +3788,8 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m) sppp_print_string((char*)passwd, passwd_len); log(-1, ">\n"); } - if (name_len > AUTHNAMELEN || - passwd_len > AUTHKEYLEN || + if (name_len != sppp_strnlen(sp->hisauth.name, AUTHNAMELEN) || + passwd_len != sppp_strnlen(sp->hisauth.secret, AUTHKEYLEN) || bcmp(name, sp->hisauth.name, name_len) != 0 || bcmp(passwd, sp->hisauth.secret, passwd_len) != 0) { /* action scn, tld */ -- cgit v1.1