From 94615b347b2be22b96f12d97137fe62278c07ed8 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 19 Jan 1999 22:15:25 +0000 Subject: [PATCH] Send the peer-decided PSTN address with the CBCP Ack, otherwise windows clients will keep resending the response :-/ It'd be nice if M$ would document this sort of thing ! Problem reported by: Andrzej Tobola --- usr.sbin/ppp/cbcp.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/usr.sbin/ppp/cbcp.c b/usr.sbin/ppp/cbcp.c index 415e6e238b2e..defa43186dd2 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.6 1998/10/25 23:35:15 brian Exp $ + * $Id: cbcp.c,v 1.7 1998/10/31 17:38:48 brian Exp $ */ #include @@ -568,7 +568,7 @@ static void cbcp_SendAck(struct cbcp *cbcp) { struct cbcp_data data; - char *end; + struct cbcp_addr *addr; /* Only callees send ACKs */ @@ -576,9 +576,22 @@ cbcp_SendAck(struct cbcp *cbcp) cbcp->fsm.id, cbcpstate(cbcp->fsm.state)); data.type = cbcp->fsm.type; - data.delay = cbcp->fsm.delay; - end = data.type == CBCP_NONUM ? (char *)&data.delay : data.addr_start; - data.length = end - (char *)&data; + switch (data.type) { + case CBCP_NONUM: + data.length = (char *)&data.delay - (char *)&data; + break; + case CBCP_CLIENTNUM: + addr = (struct cbcp_addr *)data.addr_start; + addr->type = CBCP_ADDR_PSTN; + strcpy(addr->addr, cbcp->fsm.phone); + data.delay = cbcp->fsm.delay; + data.length = addr->addr + strlen(addr->addr) + 1 - (char *)&data; + break; + default: + data.delay = cbcp->fsm.delay; + data.length = data.addr_start - (char *)&data; + break; + } cbcp_data_Show(&data); cbcp_Output(cbcp, CBCP_ACK, &data);