[NetworkManager-openvpn/bg/ipv4-invalid] helper: ignore IPv4 configuration without an address
- From: Beniamino Galvani <bgalvani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [NetworkManager-openvpn/bg/ipv4-invalid] helper: ignore IPv4 configuration without an address
- Date: Fri, 19 Feb 2021 11:03:30 +0000 (UTC)
commit ffaeb8c70e601bf130472dfef1b8be91d08fcae8
Author: Beniamino Galvani <bgalvani redhat com>
Date: Fri Feb 19 10:03:41 2021 +0100
helper: ignore IPv4 configuration without an address
This is the same as commit 56bb08f2956e ("helper: ignore IPv6
configuration without an address") but for IPv4.
NetworkManager always rejects configurations without an address, so
ignore them. A configuration without address can be created, for
example, if the server advertises IPv4 routes or domains without an
address.
src/nm-openvpn-service-openvpn-helper.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c
index d85906b..6197f97 100644
--- a/src/nm-openvpn-service-openvpn-helper.c
+++ b/src/nm-openvpn-service-openvpn-helper.c
@@ -752,12 +752,15 @@ main (int argc, char *argv[])
ip4config = g_variant_builder_end (&ip4builder);
- if (g_variant_n_children (ip4config)) {
- val = g_variant_new_boolean (TRUE);
- g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_CONFIG_HAS_IP4, val);
- } else {
+ size = g_variant_n_children (ip4config);
+ if (size == 0 || !has_ip4_address) {
+ if (size > 0)
+ _LOGW ("Ignoring IPv4 configuration without an address");
g_variant_unref (ip4config);
ip4config = NULL;
+ } else {
+ val = g_variant_new_boolean (TRUE);
+ g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_CONFIG_HAS_IP4, val);
}
ip6config = g_variant_builder_end (&ip6builder);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]