[network-manager-libreswan/lr/multiple-vpn: 9/9] fixup! service: handle route updates and deletions
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-libreswan/lr/multiple-vpn: 9/9] fixup! service: handle route updates and deletions
- Date: Wed, 4 Nov 2015 15:32:36 +0000 (UTC)
commit 90e285ee69ac31cf6e437d90e46aeadab52e0f8b
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Tue Nov 3 17:06:45 2015 +0100
fixup! service: handle route updates and deletions
src/nm-libreswan-service.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/nm-libreswan-service.c b/src/nm-libreswan-service.c
index 32b3d56..ebce1f3 100644
--- a/src/nm-libreswan-service.c
+++ b/src/nm-libreswan-service.c
@@ -1187,13 +1187,14 @@ handle_callback (NMDBusLibreswanHelper *object,
GVariant *val;
gboolean success = FALSE;
guint i;
- const char *verbs;
+ const char *verb;
g_message ("Configuration from the helper received.");
- if (g_strcmp0 (lookup_string (env, "PLUTO_VERB"), "up-client") != 0) {
- nmdbus_libreswan_helper_complete_callback (object, invocation);
- return TRUE;
+ verb = lookup_string (env, "PLUTO_VERB");
+ if (!verb) {
+ g_warning ("PLUTO_VERB missing");
+ goto out;
}
g_variant_builder_init (&config, G_VARIANT_TYPE_VARDICT);
@@ -1265,12 +1266,11 @@ handle_callback (NMDBusLibreswanHelper *object,
if (val)
g_variant_builder_add (&config, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_INT_GATEWAY, val);
- verbs = lookup_string (env, "PLUTO_VERBS");
-
/* This route */
- _take_route (priv->routes, route_to_gvariant (env),
- g_strcmp0 (verbs, "unroute-client") != 0
- && g_strcmp0 (verbs, "unroute-host") != 0);
+ if (g_strcmp0 (verb, "route-client") == 0 || g_strcmp0 (verb, "route-host"))
+ _take_route (priv->routes, route_to_gvariant (env), TRUE);
+ else if (g_strcmp0 (verb, "unroute-client") == 0 || g_strcmp0 (verb, "unroute-host"))
+ _take_route (priv->routes, route_to_gvariant (env), FALSE);
/* Routes */
g_variant_builder_init (&builder, G_VARIANT_TYPE ("aau"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]