summaryrefslogtreecommitdiffstats
path: root/sys/i4b
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2001-03-25 09:59:23 +0000
committerjoerg <joerg@FreeBSD.org>2001-03-25 09:59:23 +0000
commit8b1bec90660314c59c7223312b085bd8da4a8077 (patch)
tree32185f63a402e53a31067c23abf2a173570a9d04 /sys/i4b
parent28ec9af9483a1c93f561d336452ffb5d2547d2c7 (diff)
downloadFreeBSD-src-8b1bec90660314c59c7223312b085bd8da4a8077.zip
FreeBSD-src-8b1bec90660314c59c7223312b085bd8da4a8077.tar.gz
(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
Diffstat (limited to 'sys/i4b')
-rw-r--r--sys/i4b/driver/i4b_ispppsubr.c18
1 files 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 */
OpenPOWER on IntegriCloud