Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 26107 - ppp callback doesnt work
Summary: ppp callback doesnt work
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Heinrich Wendel (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 30243
  Show dependency tree
 
Reported: 2003-08-07 00:01 UTC by Maxim Reznik
Modified: 2003-10-04 07:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix striping last phone digit (cbcp.patch,1.45 KB, patch)
2003-09-10 04:43 UTC, Maxim Reznik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Reznik 2003-08-07 00:01:01 UTC
When I try call my provider with callback option, pppd trim last digit of my
phone number

Reproducible: Always
Steps to Reproduce:
root> pppd call provider +callback callback 123743

Actual Results:  
In /var/log/debug
Aug  2 17:46:53 undead pppd[984]: cbcp_lowerup
Aug  2 17:46:53 undead pppd[984]: want: 12
Aug  2 17:46:53 undead pppd[984]: phone no: 123743
Aug  2 17:46:53 undead pppd[984]: cbcp_open
<skip>
Aug  2 17:46:54 undead pppd[984]: rcvd [CBCP Request id=0x1 < UserDefined delay 
= 0 number = >] 00
Aug  2 17:46:54 undead pppd[984]: length: 5
Aug  2 17:46:54 undead pppd[984]: Callback: user callback, address: ''
Aug  2 17:46:54 undead pppd[984]: cbcp_resp cb_type=4
Aug  2 17:46:54 undead pppd[984]: cbcp_resp CONF_USER
Aug  2 17:46:54 undead pppd[984]: sent [CBCP Response id=0x1 < UserDefined delay
 = 5 number = 12374>] 31 32 33 37 34
Aug  2 17:46:54 undead pppd[984]: rcvd [CBCP Ack id=0x1 < UserDefined delay = 5 
number = 12374>] 31 32 33 37 34
Aug  2 17:46:54 undead pppd[984]: Callback: peer will call: '12374'


Expected Results:  
I expect something like this:
pppd[984]: sent [CBCP Response id=0x1 < UserDefined delay = 5 number = 123743>]
31 32 33 37 34 33 00


I found cause of the problem in patch ppp-crypto-fix.patch.bz2. It fix cbcp.c:
-       len = 3 + 1 + strlen(us->us_number) + 1;
+       len = 2 + 1 + strlen(us->us_number);
-       BCOPY(us->us_number, bufp, strlen(us->us_number) + 1);
+       BCOPY(us->us_number, bufp, strlen(us->us_number));
So len is calculated wrong. And length of PPP packet wrong too. When I fix
pathched cbcp.c back all worked fine and I got callback from my provider.

Here is the difference (diff cbcp.c cbcp.c.new):

<       len = 2 + 1 + strlen(us->us_number);
---
>       len = 5 + strlen(us->us_number);
450c450
<       BCOPY(us->us_number, bufp, strlen(us->us_number));
---
>       BCOPY(us->us_number, bufp, strlen(us->us_number)+1);
502c502
<       len = 2 + 1 + strlen(us->us_number);
---
>       len = 5 + strlen(us->us_number);
506c506
<       BCOPY(us->us_number, bufp, strlen(us->us_number));
---
>       BCOPY(us->us_number, bufp, strlen(us->us_number)+1);
552c552
<       len = 2 + 1 + strlen(us->us_number);
---
>       len = 5 + strlen(us->us_number);
556c556
<       BCOPY(us->us_number, bufp, strlen(us->us_number));
---
>       BCOPY(us->us_number, bufp, strlen(us->us_number)+1);
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-09-02 11:04:27 UTC
is this fixed with 2.4.1-r14 ?
Comment 2 Maxim Reznik 2003-09-09 23:32:55 UTC
No. It is not.
Sorry I forgot to mention the version.
All I wrote was about ppp-2.4.1-r14.
Comment 3 Martin Holzer (RETIRED) gentoo-dev 2003-09-10 04:00:30 UTC
could you please attach the patch so it's easyier to apply
Comment 4 Maxim Reznik 2003-09-10 04:43:49 UTC
Created attachment 17422 [details, diff]
fix striping last phone digit

ebuild ppp-2.4.1-r14.ebuild unpack
cd /var/tmp/portage/ppp-2.4.1-r14/work/
patch -p0 < /tmp/cbcp.patch

Is it suitable?
Comment 5 Heinrich Wendel (RETIRED) gentoo-dev 2003-10-02 05:56:25 UTC
should be fixed in 2.4.2_beta3 as the crypto patch is now official supported
:)