[network-manager-libreswan/lr/multiple-vpn: 5/5] 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: 5/5] fixup! service: handle route updates and deletions
- Date: Tue, 3 Nov 2015 16:13:31 +0000 (UTC)
commit df35cd823076f93e3d85be59537dc0fdeda5f91b
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 02e5878..ee0ee21 100644
--- a/src/nm-libreswan-service.c
+++ b/src/nm-libreswan-service.c
@@ -1217,13 +1217,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);
@@ -1295,12 +1296,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]