charon-nm: Prevent NM from changing the default route
authorTobias Brunner <tobias@strongswan.org>
Fri, 22 Feb 2013 17:52:17 +0000 (18:52 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 19 Mar 2013 15:25:26 +0000 (16:25 +0100)
This is not required as we install our own (narrow) route(s) in our own
routing table. This should allow split tunneling if configured on the
gateway.

src/charon-nm/nm/nm_service.c

index aa5fdc0..901abd3 100644 (file)
@@ -121,6 +121,14 @@ static void signal_ipv4_config(NMVPNPlugin *plugin,
        g_value_set_uint(val, me->get_address(me).len * 8);
        g_hash_table_insert(config, NM_VPN_PLUGIN_IP4_CONFIG_PREFIX, val);
 
+       /* prevent NM from changing the default route. we set our own route in our
+        * own routing table
+        */
+       val = g_slice_new0(GValue);
+       g_value_init(val, G_TYPE_BOOLEAN);
+       g_value_set_boolean(val, TRUE);
+       g_hash_table_insert(config, NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT, val);
+
        val = handler_to_val(handler, INTERNAL_IP4_DNS);
        g_hash_table_insert(config, NM_VPN_PLUGIN_IP4_CONFIG_DNS, val);