[network-manager-vpnc] core: don't claim default route when explicit routes are passed (bgo #621698)
- From: David Woodhouse <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-vpnc] core: don't claim default route when explicit routes are passed (bgo #621698)
- Date: Fri, 13 May 2011 23:22:10 +0000 (UTC)
commit 8d382a5f68cec8b7c606e5dce3fe1168c501404b
Author: David Woodhouse <David Woodhouse intel com>
Date: Sat May 14 00:11:55 2011 +0100
core: don't claim default route when explicit routes are passed (bgo #621698)
Requires the following NM commit:
"vpn: let plugins forbid VPN connections from getting the default route (bgo #621698)"
src/nm-vpnc-service-vpnc-helper.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/nm-vpnc-service-vpnc-helper.c b/src/nm-vpnc-service-vpnc-helper.c
index a3f9aa2..d8e7a19 100644
--- a/src/nm-vpnc-service-vpnc-helper.c
+++ b/src/nm-vpnc-service-vpnc-helper.c
@@ -134,6 +134,17 @@ uint_to_gvalue (guint32 num)
}
static GValue *
+bool_to_gvalue (gboolean b)
+{
+ GValue *val;
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_BOOLEAN);
+ g_value_set_boolean (val, b);
+ return val;
+}
+
+static GValue *
addr_to_gvalue (const char *str)
{
struct in_addr temp_addr;
@@ -361,9 +372,12 @@ main (int argc, char *argv[])
/* Routes */
val = get_routes ();
- if (val)
+ if (val) {
g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_ROUTES, val);
-
+ /* If routes-to-include were provided, that means no default route */
+ g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_NEVER_DEFAULT,
+ bool_to_gvalue (TRUE));
+ }
/* Banner */
val = str_to_gvalue (getenv ("CISCO_BANNER"), TRUE);
if (val)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]