From: Andreas Henriksson Date: Wed, 12 Oct 2016 11:27:43 +0000 (+0200) Subject: network: allow empty ip4 default gateway X-Git-Tag: archive/raspbian/1%3.26.1-2+rpi1~1^2^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=92a8a301ded7a8dfbf5e30282cb731f8ff2f621f;p=gnome-control-center.git network: allow empty ip4 default gateway Null-checking the text_gateway makes no sense as it has already been dereferenced earlier. Instead check if it's the empty string and treat that as not-an-error. Also prevent the empty string from being set in default_gateway. https://bugzilla.gnome.org/show_bug.cgi?id=708500 Gbp-Pq: Name git_allow_empty_ip4_gateway.patch --- diff --git a/panels/network/connection-editor/ce-page-ip4.c b/panels/network/connection-editor/ce-page-ip4.c index 502408a..9450029 100644 --- a/panels/network/connection-editor/ce-page-ip4.c +++ b/panels/network/connection-editor/ce-page-ip4.c @@ -765,12 +765,13 @@ ui_to_setting (CEPageIP4 *page) } if (gtk_widget_is_visible (GTK_WIDGET (gateway_entry)) && - text_gateway && !nm_utils_ipaddr_valid (AF_INET, text_gateway)) { + *text_gateway && + !nm_utils_ipaddr_valid (AF_INET, text_gateway)) { widget_set_error (g_object_get_data (G_OBJECT (row), "gateway")); ret = FALSE; } else { widget_unset_error (GTK_WIDGET (gateway_entry)); - if (gtk_widget_is_visible (GTK_WIDGET (gateway_entry))) { + if (gtk_widget_is_visible (GTK_WIDGET (gateway_entry)) && *text_gateway) { g_assert (default_gateway == NULL); default_gateway = text_gateway; }