diff options
author | brian <brian@cvs.openbsd.org> | 1999-01-19 22:17:14 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-01-19 22:17:14 +0000 |
commit | 4285297fdd1e91b7e291c2140bcf5b2efdc6ec8d (patch) | |
tree | 1d679d747ef578abfcbcfc8d2c011720a5747c97 /usr.sbin | |
parent | dd894e1b1396c53d9e2618b1fe5a9c7576f52f83 (diff) |
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 <san@tmp.iem.pw.edu.pl>
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/cbcp.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/usr.sbin/ppp/ppp/cbcp.c b/usr.sbin/ppp/ppp/cbcp.c index 83a823136c2..a71312397c7 100644 --- a/usr.sbin/ppp/ppp/cbcp.c +++ b/usr.sbin/ppp/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.3 1998/10/31 17:40:10 brian Exp $ + * $Id: cbcp.c,v 1.4 1999/01/19 22:17:13 brian Exp $ */ #include <sys/types.h> @@ -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); |