pptpconfig bugfix

I have WiFi in my home and I need to connect to provider’s VPN server to gain access to internet. Their VPN is pptp. So after some googling I find the pptpconfig project which brings ability to connect to pptp server in Linux. After installation everything was fine. This program has both cli and gui interfaces. Once I tried to to put pptpconfig in my /etc/rc.d/rc.local file to autostart pptp tunnel at system startup I noticed that it is not changing my default route in kernel routing tables. So every time I had to manualy change default route to have internet. After some investigations I noticed the error.
Here is the output of the program

# pptpconfig somename start

It gives this output:

pptpconfig: pppd process exit status 0 (started)
ip route replace dev eth1  src
pptpconfig: routes added to remote networks
ip route replace default dev
Command line is not complete. Try option "help"

pptpconfig: command failed, exit code 255
pptpconfig: default route changed to use tunnel
pptpconfig: DNS changes made to /etc/resolv.conf
pptpconfig: connected

Notice that there is a problem with invoking iproute command. So everything started, but nothing added to kernel routing table. I am used Fedora 8 at this time, but I think that this problem exists on earlier Fedoras too.
After some debugging of the code, I have fixed this problem. I have sent the patch file to pptpconfig’s developers, but James Cameron, one of the developers of this project, said that they are not planning to release a new version of pptpconfig in the near future, so anyone who have problem similar to mine, they can use CVS version of pptpconfig or just find my patch in the mailing list. Also I noticed that there were some people who used my patch and they said that it worked.
If anyone is experiencing problems like this apply this patch to pptpconfig.php

--- pptpconfig_fixed.php    2008-03-31 02:48:18.000000000 +0500
+++ pptpconfig.php    2008-01-07 21:53:56.000000000 +0400
@@ -1801,9 +1801,9 @@
$command .= 'exit $pppd_exit_code;';

$context['pipe'] = popen($command.' 2>&1', 'r');
+    socket_set_blocking($context['pipe'], FALSE);

if ($use_gui) {
-        socket_set_blocking($context['pipe'], FALSE);
$window->set_data('state', 'starting');
setup_list_set_state($name, 'starting');

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.