From 3a1284b0635257df99840614c153e23ff3d99e80 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 4 May 2012 00:28:52 +0200 Subject: Get vpn list working again, not yet perfect but at least delete works http://code.google.com/p/android/issues/detail?id=3414 is hunting me :( --- openvpn/config.h | 4 ++-- openvpn/src/openvpn/jniglue.c | 9 +++++++++ openvpn/src/openvpn/tun.c | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'openvpn') diff --git a/openvpn/config.h b/openvpn/config.h index 3dfeffc2..65193a6b 100644 --- a/openvpn/config.h +++ b/openvpn/config.h @@ -24,7 +24,7 @@ #define EMPTY_ARRAY_SIZE 0 /* Enable client capability only */ -/* #undef ENABLE_CLIENT_ONLY */ +#define ENABLE_CLIENT_ONLY 1 /* Enable client/server capability */ #define ENABLE_CLIENT_SERVER 1 @@ -42,7 +42,7 @@ #define ENABLE_MANAGEMENT 1 /* Enable multi-homed UDP server capability */ -#define ENABLE_MULTIHOME 1 +#define ENABLE_MULTIHOME 0 /* Allow --askpass and --auth-user-pass passwords to be read from a file */ #define ENABLE_PASSWORD_SAVE 1 diff --git a/openvpn/src/openvpn/jniglue.c b/openvpn/src/openvpn/jniglue.c index c0fff12b..b7167051 100644 --- a/openvpn/src/openvpn/jniglue.c +++ b/openvpn/src/openvpn/jniglue.c @@ -136,6 +136,15 @@ int android_open_tun () { } + +unsigned char android_protect_socket(int sockfd) { + jmethodID aMethodID = (*openvpnjenv)->GetStaticMethodID(openvpnjenv, openvpnclass, "protectSocket", + "(I)Z"); + return (*openvpnjenv)->CallStaticBooleanMethod(openvpnjenv,openvpnclass,aMethodID,sockfd); + +} + + void android_set_dns(const char* dns) { jmethodID aMethodID = (*openvpnjenv)->GetStaticMethodID(openvpnjenv, openvpnclass, "addDns", "(Ljava/lang/String;)V"); diff --git a/openvpn/src/openvpn/tun.c b/openvpn/src/openvpn/tun.c index 14ec2b85..238d9fba 100644 --- a/openvpn/src/openvpn/tun.c +++ b/openvpn/src/openvpn/tun.c @@ -1386,7 +1386,8 @@ open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tu if(tt->options.domain) android_set_domain(tt->options.domain); - if((tt->fd = android_open_tun()< 0){ + + if((tt->fd = android_open_tun())< 0){ msg (M_ERR, "ERROR: Cannot open TUN"); } } -- cgit v1.2.3