LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Pptpd-1.3.4 on Slackware14.0-x64 pppd 2.4.5 unrecognized option '...' and so on.. (http://www.linuxquestions.org/questions/linux-networking-3/pptpd-1-3-4-on-slackware14-0-x64-pppd-2-4-5-unrecognized-option-%FF%FF%FF-and-so-on-4175440187/)

lordbone 12-05-2012 04:17 PM

Pptpd-1.3.4 on Slackware14.0-x64 pppd 2.4.5 unrecognized option '...' and so on..
 
Hello LQ Community,

I've recently stumbled upon an error while running pptpd-1.3.4 on Slackware-14.0_x64 . To make a long story short (and not waste anyone's time), here is what happened:

After doing a full install of Slackware14_x64, I've decided to get the ol` pptpd working on the box (never know when you need a vpn on the local network, right?). All seems fine and dandy, compiled the latest (v1.3.4) pptpd on the box, created a user in chap-secrets, and gave it a try.

It seems that pptpd actually does it's job right, but passes something wrong to pppd, from what I see in the logs:

Quote:

Dec 5 22:54:29 pppd[2906]: unrecognized option ' '
Dec 5 22:54:29 pptpd[2905]: GRE: read(fd=6,buffer=606b00,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs
Dec 5 23:04:19 pptpd[3051]: CTRL: PTY read or GRE write failed (pty,gre)=(6,7)
From what I see in the debug log, pptpd seems to do it's job of authenticating the client:

Quote:

Dec 5 23:05:59 pptpd[3066]: MGR: Launching /usr/sbin/pptpctrl to handle client
Dec 5 23:05:59 pptpd[3066]: CTRL: local address = xxx.xxx.xxx.xxx
Dec 5 23:05:59 pptpd[3066]: CTRL: remote address = 10.100.10.1
Dec 5 23:05:59 pptpd[3066]: CTRL: pppd options file = /etc/ppp/options.pptpd
Dec 5 23:05:59 pptpd[3066]: CTRL: Received PPTP Control Message (type: 1)
Dec 5 23:05:59 pptpd[3066]: CTRL: Made a START CTRL CONN RPLY packet
Dec 5 23:05:59 pptpd[3066]: CTRL: I wrote 156 bytes to the client.
Dec 5 23:05:59 pptpd[3066]: CTRL: Sent packet to client
Dec 5 23:05:59 pptpd[3066]: CTRL: Received PPTP Control Message (type: 7)
Dec 5 23:05:59 pptpd[3066]: CTRL: Set parameters to 100000000 maxbps, 64 window size
Dec 5 23:05:59 pptpd[3066]: CTRL: Made a OUT CALL RPLY packet
Dec 5 23:05:59 pptpd[3066]: CTRL: pty_fd = 6
Dec 5 23:05:59 pptpd[3066]: CTRL: tty_fd = 7
Dec 5 23:05:59 pptpd[3066]: CTRL: I wrote 32 bytes to the client.
Dec 5 23:05:59 pptpd[3066]: CTRL: Sent packet to client
Dec 5 23:05:59 pptpd[3067]: CTRL (PPPD Launcher): program binary = /usr/sbin/pppd
Dec 5 23:05:59 pptpd[3067]: CTRL (PPPD Launcher): local address = xxx.xxx.xxx.xxx
Dec 5 23:05:59 pptpd[3067]: CTRL (PPPD Launcher): remote address = 10.100.10.1
Dec 5 23:05:59 pptpd[3066]: CTRL: Reaping child PPP[3067]
Dec 5 23:05:59 pptpd[3066]: CTRL: Exiting now
Dec 5 23:05:59 pptpd[3048]: MGR: Reaped child 3066
..but it seems pppd fails with the same unrecognized options.

My config files are as follows:
Quote:

# cat /etc/pptpd.conf | egrep -v "#" | sed '/^$/d'
ppp /usr/sbin/pppd
logwtmp
noipparam
plugin logwtmp.so
option /etc/ppp/options.pptpd
localip xxx.xxx.xxx.xxx
remoteip 10.100.10.1-32
debug

# cat /etc/ppp/options.pptpd | egrep -v "#" | sed '/^$/d'
debug
name pptpd
mtu 1476
mru 1476
-pap
-chap
+mschap-v2
+mppe-128
ms-dns 8.8.8.8
ms-dns 8.8.4.4
proxyarp
nologfd

# cat /etc/ppp/options | egrep -v "#" | sed '/^$/d'
crtscts
lock
modem
proxyarp
lcp-echo-interval 30
lcp-echo-failure 4
debug
It seems this is easy to reproduce. After hitting this bump, I've decided to try pptpd on some other slackware servers I currently have online. All slackware14.0 servers (I only had 64-bit ones available, never tested this on 32-bit), have the same problem! All slackware 13.37 (and below) servers, work flawlessly.

I've tried fiddling with the pppd daemon, compiling and recompiling, trying to find out what actually causes this, but I'm all out of ideas.

I can't figure out if there's a communication problem between the pptp daemon passing information to the ppp daemon, or just the ppp daemon parsing the config file and interpreting the options in a wrong way.

Best regards,
-tbone

lordbone 12-07-2012 05:31 AM

...and to answer my own question, after a little bit of digging, I've found the following post:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693136

In short, the following modifications are needed in pptpctrl.c at around line 762:

Original line says:
Code:

  if (*pppaddrs[0] || *pppaddrs[1]) {
  char pppInterfaceIPs[33];
  sprintf(pppInterfaceIPs, "%s:%s", pppaddrs[0], pppaddrs[1]);
  pppd_argv[an++] = pppInterfaceIPs;
  }

The fix looks like the following:
Code:

char pppInterfaceIPs[33];
if (*pppaddrs[0] || *pppaddrs[1]) {
  sprintf(pppInterfaceIPs, "%s:%s", pppaddrs[0], pppaddrs[1]);
  pppd_argv[an++] = pppInterfaceIPs;
}

Thank you!


All times are GMT -5. The time now is 04:09 AM.