[gnome-control-center/gnome-3-26] network: Consider empty IPv6 gateway to be valid



commit 6ff6357a1def379494650f54381a1f4656df7b4a
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 6 10:30:57 2018 +0100

    network: Consider empty IPv6 gateway to be valid
    
    The string we get back from the text entries are never NULL (as long as
    the UI isn't broken that is), but can be empty strings. Consider an
    empty IPv6 address to be invalid, but an empty gateway to be valid.
    
    See https://bugzilla.redhat.com/show_bug.cgi?id=1467308

 panels/network/connection-editor/ce-page-ip6.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-ip6.c b/panels/network/connection-editor/ce-page-ip6.c
index c9daab1..9951975 100644
--- a/panels/network/connection-editor/ce-page-ip6.c
+++ b/panels/network/connection-editor/ce-page-ip6.c
@@ -616,7 +616,7 @@ ui_to_setting (CEPageIP6 *page)
                         continue;
                 }
 
-                if (!text_address || !nm_utils_ipaddr_valid (AF_INET6, text_address)) {
+                if (!*text_address || !nm_utils_ipaddr_valid (AF_INET6, text_address)) {
                         widget_set_error (GTK_WIDGET (entry));
                         ret = FALSE;
                 } else {
@@ -631,12 +631,13 @@ ui_to_setting (CEPageIP6 *page)
                         widget_unset_error (g_object_get_data (G_OBJECT (row), "prefix"));
                 }
 
-                if (text_gateway && !nm_utils_ipaddr_valid (AF_INET6, text_gateway)) {
+                if (*text_gateway && !nm_utils_ipaddr_valid (AF_INET6, text_gateway)) {
                         widget_set_error (g_object_get_data (G_OBJECT (row), "gateway"));
                         ret = FALSE;
                 } else {
                         widget_unset_error (g_object_get_data (G_OBJECT (row), "gateway"));
-                        have_gateway = TRUE;
+                        if (*text_gateway)
+                                have_gateway = TRUE;
                 }
 
                 if (!ret)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]