summaryrefslogtreecommitdiff
path: root/openvpn/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-04 00:28:52 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-04 00:28:52 +0200
commit3a1284b0635257df99840614c153e23ff3d99e80 (patch)
tree119750363771382ea684ed0f8cff6ac7c767ca1b /openvpn/src
parent815eb143e98b57b6cd1f43c7c3007416ed4b1a91 (diff)
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 :(
Diffstat (limited to 'openvpn/src')
-rw-r--r--openvpn/src/openvpn/jniglue.c9
-rw-r--r--openvpn/src/openvpn/tun.c3
2 files changed, 11 insertions, 1 deletions
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");
}
}