Date: Sat, 5 Apr 2003 01:42:46 +0300 (EEST) From: Dmitry Pryanishnikov <dmitry@atlantis.dp.ua> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/50613: [PATCH] pppd(8) incorrect CBCP response for admin-specified number Message-ID: <200304042242.h34MgkHn025424@atlantis.dp.ua> Resent-Message-ID: <200304042250.h34Mo5A5049778@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304042242.h34MgkHn025424>