[network-manager-openconnect] helper: fix routes handling
- From: Beniamino Galvani <bgalvani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openconnect] helper: fix routes handling
- Date: Mon, 2 Nov 2015 10:35:45 +0000 (UTC)
commit 703c88d01744aeff36cbd897e22ff20ab0c38d65
Author: Beniamino Galvani <bgalvani redhat com>
Date: Mon Oct 26 09:58:25 2015 +0100
helper: fix routes handling
When only one route was received it was not added to IP configuration.
Fixes: 3b5b9de7c3ecf7e9bf3010b59d624252a4a12752
src/nm-openconnect-service-openconnect-helper.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/nm-openconnect-service-openconnect-helper.c b/src/nm-openconnect-service-openconnect-helper.c
index af2534d..177a636 100644
--- a/src/nm-openconnect-service-openconnect-helper.c
+++ b/src/nm-openconnect-service-openconnect-helper.c
@@ -236,8 +236,7 @@ get_ip4_routes (void)
GVariantBuilder builder;
GVariant *value;
char *tmp;
- int num;
- int i;
+ int size = 0, num, i;
#define BUFLEN 256
@@ -295,10 +294,11 @@ get_ip4_routes (void)
g_variant_builder_add_value (&array, g_variant_new_uint32 (next_hop));
g_variant_builder_add_value (&array, g_variant_new_uint32 (metric));
g_variant_builder_add_value (&builder, g_variant_builder_end (&array));
+ size++;
}
value = g_variant_builder_end (&builder);
- if (i > 1)
+ if (size > 0)
return value;
g_variant_unref (value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]