Blame SOURCES/0001-network-Consider-empty-IPv6-gateway-to-be-valid.patch

b8fc81
From dd8b63bdebddb736f0e871088762a9d0486bced9 Mon Sep 17 00:00:00 2001
b8fc81
From: Bastien Nocera <hadess@hadess.net>
b8fc81
Date: Tue, 6 Feb 2018 10:30:57 +0100
b8fc81
Subject: [PATCH] network: Consider empty IPv6 gateway to be valid
b8fc81
b8fc81
The string we get back from the text entries are never NULL (as long as
b8fc81
the UI isn't broken that is), but can be empty strings. Consider an
b8fc81
empty IPv6 address to be invalid, but an empty gateway to be valid.
b8fc81
b8fc81
See https://bugzilla.redhat.com/show_bug.cgi?id=1467308
b8fc81
---
b8fc81
 panels/network/connection-editor/ce-page-ip6.c | 7 ++++---
b8fc81
 1 file changed, 4 insertions(+), 3 deletions(-)
b8fc81
b8fc81
diff --git a/panels/network/connection-editor/ce-page-ip6.c b/panels/network/connection-editor/ce-page-ip6.c
b8fc81
index c9daab1ec..995197504 100644
b8fc81
--- a/panels/network/connection-editor/ce-page-ip6.c
b8fc81
+++ b/panels/network/connection-editor/ce-page-ip6.c
b8fc81
@@ -616,7 +616,7 @@ ui_to_setting (CEPageIP6 *page)
b8fc81
                         continue;
b8fc81
                 }
b8fc81
 
b8fc81
-                if (!text_address || !nm_utils_ipaddr_valid (AF_INET6, text_address)) {
b8fc81
+                if (!*text_address || !nm_utils_ipaddr_valid (AF_INET6, text_address)) {
b8fc81
                         widget_set_error (GTK_WIDGET (entry));
b8fc81
                         ret = FALSE;
b8fc81
                 } else {
b8fc81
@@ -631,12 +631,13 @@ ui_to_setting (CEPageIP6 *page)
b8fc81
                         widget_unset_error (g_object_get_data (G_OBJECT (row), "prefix"));
b8fc81
                 }
b8fc81
 
b8fc81
-                if (text_gateway && !nm_utils_ipaddr_valid (AF_INET6, text_gateway)) {
b8fc81
+                if (*text_gateway && !nm_utils_ipaddr_valid (AF_INET6, text_gateway)) {
b8fc81
                         widget_set_error (g_object_get_data (G_OBJECT (row), "gateway"));
b8fc81
                         ret = FALSE;
b8fc81
                 } else {
b8fc81
                         widget_unset_error (g_object_get_data (G_OBJECT (row), "gateway"));
b8fc81
-                        have_gateway = TRUE;
b8fc81
+                        if (*text_gateway)
b8fc81
+                                have_gateway = TRUE;
b8fc81
                 }
b8fc81
 
b8fc81
                 if (!ret)
b8fc81
-- 
b8fc81
2.14.3
b8fc81