[network-manager-openvpn] helper: improve routes handling
- From: Beniamino Galvani <bgalvani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn] helper: improve routes handling
- Date: Mon, 2 Nov 2015 10:37:47 +0000 (UTC)
commit 55fe2229c882670164f12e10edf810f2297dbcbd
Author: Beniamino Galvani <bgalvani redhat com>
Date: Mon Oct 26 10:04:20 2015 +0100
helper: improve routes handling
Return NULL instead of an empty array when there are invalid routes.
src/nm-openvpn-service-openvpn-helper.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c
index 28456da..512d6ce 100644
--- a/src/nm-openvpn-service-openvpn-helper.c
+++ b/src/nm-openvpn-service-openvpn-helper.c
@@ -198,7 +198,7 @@ get_ip4_routes (void)
GVariantBuilder builder;
GVariant *value;
char *tmp;
- int i;
+ int i, size = 0;
g_variant_builder_init (&builder, G_VARIANT_TYPE ("aau"));
@@ -257,10 +257,11 @@ get_ip4_routes (void)
g_variant_builder_add_value (&array, g_variant_new_uint32 (gateway.s_addr));
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]