diff options
Diffstat (limited to 'usr.sbin/ppp')
-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); |