(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
This commit is contained in:
joerg 2001-03-25 09:59:23 +00:00
parent 28ec9af948
commit 8b1bec9066

View File

@ -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 */