diff options
author | brian <brian@FreeBSD.org> | 1999-07-27 13:47:59 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-07-27 13:47:59 +0000 |
commit | 1ff3ce939bc6d691592d295855f9b8422cbece7a (patch) | |
tree | 9c43a84c7d34096bf24e11ec324d008e58f890a7 /usr.sbin/ppp/cbcp.c | |
parent | 1dfe5b2f8955ee6bec4d96b3d572f797114813f3 (diff) | |
download | FreeBSD-src-1ff3ce939bc6d691592d295855f9b8422cbece7a.zip FreeBSD-src-1ff3ce939bc6d691592d295855f9b8422cbece7a.tar.gz |
If we've negotiated CBCP and have also specified ``none'' as a possible
callback option, and the server sends us CBCP_NONUM, proceed directly
to the network phase rather than insisting on our configured CBCP
option.
Mostly submitted by: kkphang <phang@dgate.po.my>
Diffstat (limited to 'usr.sbin/ppp/cbcp.c')
-rw-r--r-- | usr.sbin/ppp/cbcp.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/usr.sbin/ppp/cbcp.c b/usr.sbin/ppp/cbcp.c index 1c4d3cc..e250bae 100644 --- a/usr.sbin/ppp/cbcp.c +++ b/usr.sbin/ppp/cbcp.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cbcp.c,v 1.12 1999/05/08 11:06:10 brian Exp $ + * $Id: cbcp.c,v 1.13 1999/06/02 15:58:53 brian Exp $ */ #include <sys/param.h> @@ -356,11 +356,20 @@ cbcp_AdjustResponse(struct cbcp *cbcp, struct cbcp_data *data) switch (data->type) { case CBCP_NONUM: + if (cbcp->p->dl->cfg.callback.opmask & CALLBACK_BIT(CALLBACK_NONE)) + /* + * if ``none'' is a configured callback possibility + * (ie, ``set callback cbcp none''), go along with the callees + * request + */ + cbcp->fsm.type = CBCP_NONUM; + /* - * If the callee offers no callback, we send our desired response - * anyway. This is what Win95 does - although I can't find this - * behaviour documented in the spec.... + * Otherwise, we send our desired response anyway. This seems to be + * what Win95 does - although I can't find this behaviour documented + * in the CBCP spec.... */ + return 1; case CBCP_CLIENTNUM: @@ -701,7 +710,14 @@ cbcp_Input(struct bundle *bundle, struct link *l, struct mbuf *bp) cbcp->fsm.id, head->id); cbcp->fsm.id = head->id; } - if (cbcp->fsm.state == CBCP_RESPSENT) { + if (cbcp->fsm.type == CBCP_NONUM) { + /* + * Don't change state in case the peer doesn't get our ACK, + * just bring the layer up. + */ + timer_Stop(&cbcp->fsm.timer); + datalink_NCPUp(cbcp->p->dl); + } else if (cbcp->fsm.state == CBCP_RESPSENT) { timer_Stop(&cbcp->fsm.timer); datalink_CBCPComplete(cbcp->p->dl); log_Printf(LogPHASE, "%s: CBCP: Peer will dial back\n", p->dl->name); |