This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

VPN PPTP on TI-Android-Gingerbread-2.3.4-DevKit2.1 Not Functional

What steps will reproduce the problem?
1. Add to kernel build (CONFIG_PPP, CONFIG_PPP_ASYNC, CONFIG_PPP_SYNC,
CONFIG_PPP_DEFLATE, CONFIG_PPP_BSDCOMP, CONFIG_PPP_MPPE, CONFIG_PPPOLAC
CONFIG_PPPOPNS, CONFIG_INET_AH, CONFIG_INET_ESP, CONFIG_INET_IPCOMP,
CONFIG_INET_XFRM_MODE_TRANSPORT, CONFIG_INET_XFRM_MODE_TUNNEL,
CONFIG_INET_XFRM_MODE_BEET)

2. Build Kernel / Android
3. Place on SD card and Boot Android
4. Enable Ethernet, and setprop net.dns1 = xx.xx.xx.xx
5. Test network connection. ping www.xyz.com. (make sure ethernet / dns / routes work)
6. make sure you can ping the vpn router
3. make a pptp vpn connection in (settings / wirless / vpn) in android gui
or run from console
 (mtpd pptp xx.xx.xx.xx 1723 "linkname vpn name xxxxx password xxxx refuse_eap nodefaultroute usepeerdns idle 1800 mtu 1300 mru 1300" &) with out mppe
(mtpd pptp xx.xx.xx.xx 1723 "linkname vpn name xxxxx password xxxx refuse_eap nodefaultroute usepeerdns idle 1800 mtu 1300 mru 1300 +mppe" &) with mppe

What is the expected output? What do you see instead?
should see a connection made
running logcat we see

I/mtpd (2343): Using protocol pptp
I/mtpd (2343): Connecting 192.168.220.238 port 1723
I/mtpd (2343): Connection established (socket = 10)
D/mtpd (2343): Sending SCCRQ
D/mtpd (2343): Received SCCRP -> Sending OCRQ (local = 12339) -- Here we see that the SCCRP is received line 290 in pptp.c
I/mtpd (2343): Tunnel established
D/mtpd (2343): Received OCRQ (remote = 10255)
I/mtpd (2343): Session established
I/mtpd (2343): Creating PPPoX socket -- mtpd.c calling pptp.c create_pppox line 237
F/mtpd (2343): Connect() Invalid argument -- pptp.c line 252

mtpd dies

pptp.c -- create_pppox starting at line 251

if (connect(pppox, (struct sockaddr *)&address, sizeof(address)) != 0) {
log_print(FATAL, "Connect() %s", strerror(errno));
exit(SYSTEM_ERROR);
}

sterror(errno) is returning Invalid argument
system exits with error and mtpd terminates
(sizeof(address)) is returning = 14

What version of the product are you using? On what operating system?
TI-Android-Gingerbread- 2.3.4-DevKit2.1 Latest GIT Sunday 10/24/2011

Please provide any additional information below.

Added code to pptp.c in external/mtpd
to display sizeof(address)
size of address returned from connect(pppox,
is = 14.

code below

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));
log_print(FATAL, "CONNECT address size %d", sizeof(address);
exit(SYSTEM_ERROR);
}
}
return pppox;
}


Looks like a problem in connect(pppox,


VPN routers tried are MikroTik 5.4, MS Windows 2003, MS Windows 2008, Dlink
  • We have not tested the VPN feature with our DevKit.

    We shall look into this and get back to you. Thanks for reporting this.

  • Further Information.

    1. Have now tried 0xdroid port for TI and the beagleboard and the VPN fails at the same line "connect(PPPOX," as before

    2. Tried Android-x86 and the same error.

    It is beginning to look like this is an error in the entire Android Gingerbread line

     

    PS: rowboat kernel 2.6.37

           0xdroid kernel 2.6.35

          Android-x86 kernel 2.6.39

  • I have found the answer to this problem. This goes all the way back to the master branch and was introduced by changes made in 2009 (FROYO)

    PX_PROTO_OLAC and PX_PROTO_OPNS in the Bionic / libc /kernel / linux chain do not match those in the kernel / include chain!!!

    Sloppy Coding and/or checking

    TI and/or rowboat if you want help from a very senior special projects engineer on patching this code. please email me with instructions to post or submit to your GIT:

    Please for give my Sloppy comment, but I have coded to the DOD-2167 standard all of my carrier.

    The Patch is

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

    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;

  • Thanks for debugging this and obtaining the solution.

    We hope to integrate this fix in our release soon.