From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 4 14:50:06 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9A3E37B401 for ; Fri, 4 Apr 2003 14:50:06 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C863443FAF for ; Fri, 4 Apr 2003 14:50:05 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h34Mo5Up049779 for ; Fri, 4 Apr 2003 14:50:05 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h34Mo5A5049778; Fri, 4 Apr 2003 14:50:05 -0800 (PST) Resent-Date: Fri, 4 Apr 2003 14:50:05 -0800 (PST) Resent-Message-Id: <200304042250.h34Mo5A5049778@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Pryanishnikov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4673B37B401 for ; Fri, 4 Apr 2003 14:42:59 -0800 (PST) Received: from smtp.atlantis.dp.ua (smtp.atlantis.dp.ua [193.108.46.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id C745943F3F for ; Fri, 4 Apr 2003 14:42:56 -0800 (PST) (envelope-from dmitry@atlantis.dp.ua) Received: from atlantis.dp.ua (localhost [127.0.0.1]) by smtp.atlantis.dp.ua (8.12.6p2/8.12.6) with ESMTP id h34MglL1025434 for ; Sat, 5 Apr 2003 01:42:47 +0300 (EEST) (envelope-from dmitry@atlantis.dp.ua) Received: (from dmitry@localhost) by atlantis.dp.ua (8.12.6p2/8.12.6/Submit) id h34MgkHn025424; Sat, 5 Apr 2003 01:42:46 +0300 (EEST) (envelope-from dmitry) Message-Id: <200304042242.h34MgkHn025424@atlantis.dp.ua> Date: Sat, 5 Apr 2003 01:42:46 +0300 (EEST) From: Dmitry Pryanishnikov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/50613: [PATCH] pppd(8) incorrect CBCP response for admin-specified number X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dmitry Pryanishnikov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2003 22:50:07 -0000 >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 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 ( 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: