[network-manager-openvpn] helper: don't add a default /32 IPv4 prefix if there's no IPv4 address
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn] helper: don't add a default /32 IPv4 prefix if there's no IPv4 address
- Date: Fri, 13 Nov 2015 15:15:47 +0000 (UTC)
commit 63ddc1fc336cb5456f4e607d49817268c4c859f7
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Fri Nov 13 14:41:00 2015 +0100
helper: don't add a default /32 IPv4 prefix if there's no IPv4 address
This caused an (invalid) IPv4 config to be always present, upsetting the
daemon.
Based on a patch from Rafaël Carré <funman videolan org>
src/nm-openvpn-service-openvpn-helper.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c
index 00f71a8..1a162cd 100644
--- a/src/nm-openvpn-service-openvpn-helper.c
+++ b/src/nm-openvpn-service-openvpn-helper.c
@@ -440,6 +440,7 @@ main (int argc, char *argv[])
int shift = 0;
gboolean is_restart;
gboolean has_ip4_prefix = FALSE;
+ gboolean has_ip4_address = FALSE;
gchar *bus_name = NM_DBUS_SERVICE_OPENVPN;
#if !GLIB_CHECK_VERSION (2, 35, 0)
@@ -554,9 +555,10 @@ main (int argc, char *argv[])
tmp = argv[4];
if (tmp && strlen (tmp)) {
val = addr4_to_gvariant (tmp);
- if (val)
+ if (val) {
+ has_ip4_address = TRUE;
g_variant_builder_add (&ip4builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS, val);
- else
+ } else
helper_failed (proxy, "IP4 Address");
}
@@ -595,7 +597,7 @@ main (int argc, char *argv[])
val = g_variant_new_uint32 (nm_utils_ip4_netmask_to_prefix (temp_addr.s_addr));
g_variant_builder_add (&ip4builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_PREFIX, val);
} else if (!tapdev) {
- if (!has_ip4_prefix) {
+ if (has_ip4_address && !has_ip4_prefix) {
val = g_variant_new_uint32 (32);
g_variant_builder_add (&ip4builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_PREFIX, val);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]