android: Replace android-net plugin with kernel-netlink
authorTobias Brunner <tobias@strongswan.org>
Tue, 16 Apr 2013 12:31:09 +0000 (14:31 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 3 May 2013 13:11:19 +0000 (15:11 +0200)
Virtual IPs are not handled by the kernel-netlink plugin and tun devices are
ignored.

src/frontends/android/jni/Android.mk
src/frontends/android/jni/libandroidbridge/charonservice.c

index 9805bff..0ae18fc 100644 (file)
@@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
 strongswan_CHARON_PLUGINS := android-log openssl fips-prf random nonce pubkey \
 include $(CLEAR_VARS)
 
 strongswan_CHARON_PLUGINS := android-log openssl fips-prf random nonce pubkey \
-       pkcs1 pkcs8 pem xcbc hmac socket-default \
+       pkcs1 pkcs8 pem xcbc hmac socket-default kernel-netlink \
        eap-identity eap-mschapv2 eap-md5 eap-gtc
 
 strongswan_PLUGINS := $(strongswan_CHARON_PLUGINS)
        eap-identity eap-mschapv2 eap-md5 eap-gtc
 
 strongswan_PLUGINS := $(strongswan_CHARON_PLUGINS)
index b6a9b7c..4b2e58b 100644 (file)
@@ -410,6 +410,13 @@ static void set_options(char *logfile)
         * information */
        lib->settings->set_bool(lib->settings,
                                        "charon.plugins.socket-default.set_source", FALSE);
         * information */
        lib->settings->set_bool(lib->settings,
                                        "charon.plugins.socket-default.set_source", FALSE);
+       /* don't install virtual IPs via kernel-netlink */
+       lib->settings->set_bool(lib->settings,
+                                       "charon.install_virtual_ip", FALSE);
+       /* ignore tun devices (it's mostly tun0 but it may already be taken, ignore
+        * some others too) */
+       lib->settings->set_str(lib->settings,
+                                       "charon.interfaces_ignore", "tun0, tun1, tun2, tun3, tun4");
 }
 
 /**
 }
 
 /**
@@ -419,8 +426,6 @@ static void charonservice_init(JNIEnv *env, jobject service, jobject builder)
 {
        private_charonservice_t *this;
        static plugin_feature_t features[] = {
 {
        private_charonservice_t *this;
        static plugin_feature_t features[] = {
-               PLUGIN_CALLBACK(kernel_net_register, kernel_android_net_create),
-                       PLUGIN_PROVIDE(CUSTOM, "kernel-net"),
                PLUGIN_CALLBACK(kernel_ipsec_register, kernel_android_ipsec_create),
                        PLUGIN_PROVIDE(CUSTOM, "kernel-ipsec"),
                PLUGIN_CALLBACK((plugin_feature_callback_t)charonservice_register, NULL),
                PLUGIN_CALLBACK(kernel_ipsec_register, kernel_android_ipsec_create),
                        PLUGIN_PROVIDE(CUSTOM, "kernel-ipsec"),
                PLUGIN_CALLBACK((plugin_feature_callback_t)charonservice_register, NULL),