[network-manager-openconnect/lr/ipv6: 1/4] helper: drop requirement for mandatory IPv4
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openconnect/lr/ipv6: 1/4] helper: drop requirement for mandatory IPv4
- Date: Sat, 19 Nov 2016 14:06:23 +0000 (UTC)
commit 7ed226393b1d5dd9a6def6d39024ef3a9b317f07
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Sat Nov 19 10:21:29 2016 +0100
helper: drop requirement for mandatory IPv4
src/nm-openconnect-service-openconnect-helper.c | 26 ++++++++++++++--------
1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/src/nm-openconnect-service-openconnect-helper.c b/src/nm-openconnect-service-openconnect-helper.c
index 40861d4..30e447a 100644
--- a/src/nm-openconnect-service-openconnect-helper.c
+++ b/src/nm-openconnect-service-openconnect-helper.c
@@ -551,18 +551,24 @@ main (int argc, char *argv[])
}
/* IPv4 address */
- val = addr4_to_gvariant (getenv ("INTERNAL_IP4_ADDRESS"));
- if (val)
- g_variant_builder_add (&ip4builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS, val);
- else
- helper_failed (proxy, "IP4 Address");
+ tmp = getenv ("INTERNAL_IP4_ADDRESS");
+ if (tmp && strlen (tmp)) {
+ val = addr4_to_gvariant (tmp);
+ if (val)
+ g_variant_builder_add (&ip4builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS, val);
+ else
+ helper_failed (proxy, "IP4 Address");
+ }
/* IPv4 PTP address; for openconnect PTP address == internal IPv4 address */
- val = addr4_to_gvariant (getenv ("INTERNAL_IP4_ADDRESS"));
- if (val)
- g_variant_builder_add (&ip4builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_PTP, val);
- else
- helper_failed (proxy, "IP4 PTP Address");
+ tmp = getenv ("INTERNAL_IP4_ADDRESS");
+ if (tmp && strlen (tmp)) {
+ val = addr4_to_gvariant (tmp);
+ if (val)
+ g_variant_builder_add (&ip4builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_PTP, val);
+ else
+ helper_failed (proxy, "IP4 Address");
+ }
/* IPv4 Netmask */
tmp = getenv ("INTERNAL_IP4_NETMASK");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]