summaryrefslogtreecommitdiff
path: root/openvpn/src
diff options
context:
space:
mode:
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");
}
}