From 9eb45a6b3026f724fe15df5ae20c2c33d17740b0 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 7 Jan 2005 20:19:54 +0000 Subject: [PATCH] Correct two bugs that may result in incorrect CBCP response for administrator specified number. The implementation in our version transmits extra zero byte that is a violation of the Microsoft PPP Callback Control Protocol section 3.2[1]. This can lead to incorrect behavior on certain devices, as reported in bin/50613. Confirmed with: cbcp.c in ppp's cvs, rev. 1.4 and 1.15 [2] Submitted-by: Xin LI Taken-From: FreeBSD/rev1.7 Submitted-to-FreeBSD-by: Dmitry Pryanishnikov PR: FreeBSD:bin/50613 --- usr.sbin/pppd/cbcp.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/usr.sbin/pppd/cbcp.c b/usr.sbin/pppd/cbcp.c index 683672a8b7..bb5228e7eb 100644 --- a/usr.sbin/pppd/cbcp.c +++ b/usr.sbin/pppd/cbcp.c @@ -18,7 +18,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * $FreeBSD: src/usr.sbin/pppd/cbcp.c,v 1.4 1999/08/28 01:19:00 peter Exp $ - * $DragonFly: src/usr.sbin/pppd/cbcp.c,v 1.4 2004/11/05 07:27:20 dillon Exp $ + * $DragonFly: src/usr.sbin/pppd/cbcp.c,v 1.5 2005/01/07 20:19:54 dillon Exp $ */ #include @@ -343,10 +343,9 @@ cbcp_resp(us) if (cb_type & ( 1 << CB_CONF_ADMIN ) ) { syslog(LOG_DEBUG, "cbcp_resp CONF_ADMIN"); PUTCHAR(CB_CONF_ADMIN, bufp); - len = 3 + 1; - PUTCHAR(len , bufp); + len = 3; + PUTCHAR(len, bufp); PUTCHAR(5, bufp); /* delay */ - PUTCHAR(0, bufp); cbcp_send(us, CBCP_RESP, buf, len); return; } @@ -354,9 +353,8 @@ cbcp_resp(us) if (cb_type & ( 1 << CB_CONF_NO ) ) { syslog(LOG_DEBUG, "cbcp_resp CONF_NO"); PUTCHAR(CB_CONF_NO, bufp); - len = 3; + len = 2; PUTCHAR(len , bufp); - PUTCHAR(0, bufp); cbcp_send(us, CBCP_RESP, buf, len); (*ipcp_protent.open)(us->us_unit); return; -- 2.41.0