bin/50613: [PATCH] pppd(8) incorrect CBCP response for admin-specified number

Dmitry Pryanishnikov dmitry at atlantis.dp.ua
Fri Apr 4 14:50:07 PST 2003


>Number:         50613
>Category:       bin
>Synopsis:       [PATCH] pppd(8) incorrect CBCP response for admin-specified number
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 04 14:50:04 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Pryanishnikov
>Release:        FreeBSD 4.7-RELEASE i386
>Organization:
Atlantis ISP
>Environment:
System: FreeBSD atlantis.atlantis.dp.ua 4.7-RELEASE FreeBSD 4.7-RELEASE #2: Mon Feb 24 17:35:38 EET 2003 root at atlantis.atlantis.dp.ua:/usr/src/sys/compile/ATLANTIS i386

>Description:
   pppd(8) can be used for requesting callback from an access server via CBCP
by specifying parameter

callback <phone-number>

Access server can use two types of callback: callback to user-specified number
and callback to administrator specified number. In the last case, phone-number
will be ignored and pppd just sets callback delay in CBCP response packet.
However, this type of CBCP doesn't work with Ascend MAX4060, CBCP never
finished:

Apr  5 00:33:10 homelynx pppd[2152]: cbcp_open
Apr  5 00:33:10 homelynx pppd[2152]: rcvd [CBCP Request id=0x1 < AdminDefined delay = 0>]
Apr  5 00:33:10 homelynx pppd[2152]: length: 3
Apr  5 00:33:10 homelynx pppd[2152]: user admin defined allowed
Apr  5 00:33:10 homelynx pppd[2152]: cbcp_resp cb_type=8
Apr  5 00:33:10 homelynx pppd[2152]: cbcp_resp CONF_ADMIN
Apr  5 00:33:10 homelynx pppd[2152]: sent [CBCP Response id=0x1 < AdminDefined delay = 5 number = >]
Apr  5 00:33:19 homelynx pppd[2152]: sent [LCP EchoReq id=0x1 magic=0x20880b5d]
Apr  5 00:33:19 homelynx pppd[2152]: rcvd [LCP EchoRep id=0x1 magic=0x0]
Apr  5 00:33:29 homelynx pppd[2152]: sent [LCP EchoReq id=0x2 magic=0x20880b5d]

It's easy to see (number= ) that pppd(8) transmits extra zero byte at the end
of response packet, which confuses MAX. In Microsoft's CBCP specification
clearly said that only callback delay must be present in this type of response.

>How-To-Repeat:
   Try to request a callback from MAX4060 which uses CBCP callback to
administrator specified phone number using

pppd callback <phone-number> 

(<phone-number> can be any string, it's ignored for this type of callback).

>Fix:
   Patch is really trivial, it just removes dummy zero byte at the end of
packet:

--- cbcp.c.orig	Sat Aug 28 04:19:00 1999
+++ cbcp.c	Sat Apr  5 00:48:20 2003
@@ -343,10 +343,9 @@
     if (cb_type & ( 1 << CB_CONF_ADMIN ) ) {
 	syslog(LOG_DEBUG, "cbcp_resp CONF_ADMIN");
         PUTCHAR(CB_CONF_ADMIN, bufp);
-	len = 3 + 1;
+	len = 3;
 	PUTCHAR(len , bufp);
 	PUTCHAR(5, bufp); /* delay */
-	PUTCHAR(0, bufp);
 	cbcp_send(us, CBCP_RESP, buf, len);
 	return;
     }

After applying this patch CBCP works correctly:

Apr  5 00:50:34 homelynx pppd[2497]: cbcp_open
Apr  5 00:50:34 homelynx pppd[2497]: rcvd [CBCP Request id=0x1 < AdminDefined delay = 0>]
Apr  5 00:50:34 homelynx pppd[2497]: length: 3
Apr  5 00:50:34 homelynx pppd[2497]: user admin defined allowed
Apr  5 00:50:34 homelynx pppd[2497]: cbcp_resp cb_type=8
Apr  5 00:50:34 homelynx pppd[2497]: cbcp_resp CONF_ADMIN
Apr  5 00:50:34 homelynx pppd[2497]: sent [CBCP Response id=0x1 < AdminDefined delay = 5>]
Apr  5 00:50:34 homelynx pppd[2497]: rcvd [CBCP Ack id=0x1 < AdminDefined delay = 5>]
Apr  5 00:50:34 homelynx pppd[2497]: sent [LCP TermReq id=0x2 "Call me back, please"]
Apr  5 00:50:34 homelynx pppd[2497]: rcvd [LCP TermAck id=0x2]
   
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list