From ef4fd36f5d38e82ba6165be2468d985d62f1d32f Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sun, 6 May 2012 18:13:09 +0200 Subject: Add ability to send the log (closes issue #9) protect fd over unix socket --- openvpn/src/openvpn/jniglue.c | 17 ----------------- openvpn/src/openvpn/jniglue.h | 2 -- openvpn/src/openvpn/tun.c | 4 +++- 3 files changed, 3 insertions(+), 20 deletions(-) (limited to 'openvpn') diff --git a/openvpn/src/openvpn/jniglue.c b/openvpn/src/openvpn/jniglue.c index b716705..d49fe35 100644 --- a/openvpn/src/openvpn/jniglue.c +++ b/openvpn/src/openvpn/jniglue.c @@ -137,14 +137,6 @@ 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"); @@ -152,15 +144,6 @@ void android_set_dns(const char* dns) { (*openvpnjenv)->CallStaticVoidMethod(openvpnjenv,openvpnclass,aMethodID,jdns); -} - -void android_set_domain(const char* domain) { - jmethodID aMethodID = (*openvpnjenv)->GetStaticMethodID(openvpnjenv, openvpnclass, "addDomain", - "(Ljava/lang/String;)V"); - jstring jdomain = (*openvpnjenv)->NewStringUTF(openvpnjenv,domain); - (*openvpnjenv)->CallStaticVoidMethod(openvpnjenv,openvpnclass,aMethodID,jdomain); - - } void addRouteInformation(const char* dest, const char* mask, const char* gw) { diff --git a/openvpn/src/openvpn/jniglue.h b/openvpn/src/openvpn/jniglue.h index 7c723ef..ea60a71 100644 --- a/openvpn/src/openvpn/jniglue.h +++ b/openvpn/src/openvpn/jniglue.h @@ -15,6 +15,4 @@ void addInterfaceInformation(int mtu,const char* ifconfig_local, const char* ifc void android_openvpn_log(int level,const char* prefix,const char* prefix_sep,const char* m1); void android_openvpn_exit(int status); void android_set_dns(const char* dns); -void android_set_domain(const char* domain); - #endif diff --git a/openvpn/src/openvpn/tun.c b/openvpn/src/openvpn/tun.c index 238d9fb..844d596 100644 --- a/openvpn/src/openvpn/tun.c +++ b/openvpn/src/openvpn/tun.c @@ -1384,8 +1384,10 @@ open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tu android_set_dns(print_in_addr_t(tt->options.dns[i], 0, &gc)); } + + if(tt->options.domain) - android_set_domain(tt->options.domain); + management_query_user_pass(management, &up , "DNSDOMAIN", GET_USER_PASS_NEED_OK,(void*) 0); if((tt->fd = android_open_tun())< 0){ msg (M_ERR, "ERROR: Cannot open TUN"); -- cgit v1.2.3