PPTP VPN FAILURES

652 views
Skip to first unread message

William Esser

unread,
Nov 6, 2011, 12:43:51 PM11/6/11
to Android-x86
There is an error in the system during the connect(pppox) call in the
pptp.c under /external/mtpd
there is a *.h def mis match here in the bionic/libc/kernel/common/
linux files if_pppolac.h and if_pppopns.h

patch follows

diff --git a/libc/kernel/common/linux/if_pppolac.h b/libc/kernel/
common/linux/if_pppolac.h
index bf6eba0..f3c8bb1 100644
--- a/libc/kernel/common/linux/if_pppolac.h
+++ b/libc/kernel/common/linux/if_pppolac.h
@@ -15,7 +15,8 @@
#include <linux/socket.h>
#include <linux/types.h>

-#define PX_PROTO_OLAC 2
+/* was 2 */
+#define PX_PROTO_OLAC 3

struct sockaddr_pppolac {
sa_family_t sa_family;


diff --git a/libc/kernel/common/linux/if_pppopns.h b/libc/kernel/
common/linux/if_pppopns.h
index ac75210..106b4d1 100644
--- a/libc/kernel/common/linux/if_pppopns.h
+++ b/libc/kernel/common/linux/if_pppopns.h
@@ -15,7 +15,8 @@
#include <linux/socket.h>
#include <linux/types.h>

-#define PX_PROTO_OPNS 3
+/* was 3 */
+#define PX_PROTO_OPNS 4

struct sockaddr_pppopns {
sa_family_t sa_family;

Chih-Wei Huang

unread,
Nov 7, 2011, 8:50:02 PM11/7/11
to andro...@googlegroups.com
Thank you for the patch.
But could you explain more about what mismatched?
I didn't see PX_PROTO_OLAC or PX_PROTO_OPNS
defined in external/mtpd/* ?

Besides, please consider to submit the patch to Google
if it's a bug of the bionic.

2011/11/7 William Esser <markes...@gmail.com>:

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

William Esser

unread,
Nov 10, 2011, 3:11:48 PM11/10/11
to Android-x86
Yes,

The header loaded in during the linux build kernel/include/linux/
if_pppox.h has the following
defines
/
************************************************************************
* Protocols supported by AF_PPPOX
*/
#define PX_PROTO_OE 0 /* Currently just PPPoE */
#define PX_PROTO_OL2TP 1 /* Now L2TP also */
#define PX_PROTO_PPTP 2
#define PX_PROTO_OLAC 3
#define PX_PROTO_OPNS 4
#define PX_MAX_PROTO 5
*****************************************************

in bionic/libc/kernel/common/if_pppolac.h
#define PX_PROTO_OLAC 2

in bionic/libc/kernel/common/if_pppopns.h
#define PX_PROTO_OPNS 3

when using connect(PPPOX, call in pptp.c in external/mtpd
for pptp it sends a PX_PROTO_OPNS = 2 (but pppox should send a 4)
and returns a INVALID PARAMETER error

when using connect(PPPOX, call in l2tp.c in external/mtpd
for l2tp it sends a PX_PROTO_OLAC = 2 (but pppox should send a 3)

-----------------------------

On Nov 7, 5:50 pm, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> Thank you for the patch.
> But could you explain more about what mismatched?
> I didn't see PX_PROTO_OLAC or PX_PROTO_OPNS
> defined in external/mtpd/* ?
>
> Besides, please consider to submit the patch to Google
> if it's a bug of the bionic.
>
> 2011/11/7 William Esser <markesser...@gmail.com>:

Chih-Wei Huang

unread,
Nov 13, 2011, 4:04:17 AM11/13/11
to andro...@googlegroups.com
Thank you for the explanation.
I've applied the fix to gingerbread-x86.

2011/11/11 William Esser <markes...@gmail.com>:


> Yes,
>
> The header loaded in during the linux build kernel/include/linux/
> if_pppox.h has the following
> defines
> /
> ************************************************************************
>  * Protocols supported by AF_PPPOX
>  */
> #define PX_PROTO_OE    0 /* Currently just PPPoE */
> #define PX_PROTO_OL2TP 1 /* Now L2TP also */
> #define PX_PROTO_PPTP  2
> #define PX_PROTO_OLAC  3
> #define PX_PROTO_OPNS  4
> #define PX_MAX_PROTO   5
> *****************************************************
>
> in bionic/libc/kernel/common/if_pppolac.h
> #define PX_PROTO_OLAC 2
>
> in bionic/libc/kernel/common/if_pppopns.h
> #define PX_PROTO_OPNS 3
>
> when using connect(PPPOX, call in pptp.c in external/mtpd
> for pptp it sends a PX_PROTO_OPNS = 2 (but pppox should send a 4)
> and returns a INVALID PARAMETER error
>
> when using connect(PPPOX, call in l2tp.c in external/mtpd
> for l2tp it sends a PX_PROTO_OLAC = 2 (but pppox should send a 3)

--

Shady Rasheed

unread,
Dec 20, 2011, 6:04:53 AM12/20/11
to andro...@googlegroups.com
I'm facing problems with VPNs. In Honeycomb, the changes mentioned in this conversation are already applied, however I still can't connect to a VPN server. From my N1 it works.

The error I'm getting in logcat is as follows:
Creating PPPoX socket
Socket() Protocol not supported.

Looking into the pptp.c
static int create_pppox()
{
    int pppox;
    log_print(INFO, "Creating PPPoX socket");
    pppox = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OPNS);
    if (pppox == -1) {
        log_print(FATAL, "Socket() %s", strerror(errno));
        exit(SYSTEM_ERROR);

    } else {
        struct sockaddr_pppopns address = {
            .sa_family = AF_PPPOX,
            .sa_protocol = PX_PROTO_OPNS,
            .tcp_socket = the_socket,
            .local = local,
            .remote = remote,
        };
        if (connect(pppox, (struct sockaddr *)&address, sizeof(address)) != 0) {
            log_print(FATAL, "Connect() %s", strerror(errno));
            exit(SYSTEM_ERROR);
        }
    }
    return pppox;
}

And in socket.h
/* Create a new socket of type TYPE in domain DOMAIN, using
   protocol PROTOCOL.  If PROTOCOL is zero, one is chosen automatically.
   Returns a file descriptor for the new socket, or -1 for errors.  */
extern int socket (int __domain, int __type, int __protocol) __THROW; 

I'm not sure how to investigate this further... but having vpn working can be quite handy.

Any info about this??? 

http://www.android-x86.org

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-x86...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.


Chih-Wei Huang

unread,
Dec 21, 2011, 10:52:46 AM12/21/11
to andro...@googlegroups.com
Have you load the pppox module?
I think it's not default on in an android-x86 kernel.

2011/12/20 Shady Rasheed <rashee...@gmail.com>:

William Esser

unread,
Dec 21, 2011, 11:35:05 AM12/21/11
to Android-x86
You need the following in your kernel

PPP
PPP_MULTILINK
PPP_FILTER
PPP_ASYNC ( for 3G stuff)
PPP_DEFLATE
PPP_BSDCOMP
PPP_MPPE ( needed for MS PPTP )
PPPOLAC
PPPOPNS
SLHC

On Dec 21, 7:52 am, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> Have you load the pppox module?
> I think it's not default on in an android-x86 kernel.
>
> 2011/12/20 Shady Rasheed <rasheedsh...@gmail.com>:

Shady Rasheed

unread,
Dec 22, 2011, 12:42:55 AM12/22/11
to andro...@googlegroups.com
Thank you for an informative response.

From the list above some modules where already loaded.

The following were not loaded and I could load them manually..
pppopns, pppolac, pppox

However, ppp_mppe was found but I can't load it, it says modprobe: kernel/drivers/net/ppp_mppe.ko: No Such device

The modules that I couldn't find are: ppp_bsdcomp, ppp, ppp_filter, ppp_multilink

Loading these modules pppopns, pppolac, pppox... gets me past that Socket() Protocol not supported. But Now I get a server hung up Message. In logcat it says ppp0 is not a tetherable iface, ignoring
a few lines later it says: LCP terminated by peer
Remote server hung up.


This is without encryption enabled.
If i enable encryption it will say that the kernel doesn't support it.


I hope you have some insightful tips... 

Thanks in advance


Shady Rasheed

unread,
Dec 22, 2011, 3:07:18 AM12/22/11
to andro...@googlegroups.com
In debug i was able to modprobe ppp_mppe
and when in the ui, i could connect to the vpn... 

Is there a way to load those modules on startup ppp_mppe, pppolac, pppopns, pppox
I'd rather not recompile the image, if there's a script I can edit... 

Thanks in advance
Reply all
Reply to author
Forward
0 new messages