GNOME Bugzilla – Bug 708500
Network settings should not require a gateway
Last modified: 2016-11-11 16:56:46 UTC
I assume that "Use this connection only for resources on its network" means "Don't set a default route". (I appreciate trying to speak plain English here, but it's not entirely clear what this means.) With that option set, there's no reason to specify a gateway. Nevertheless, the dialog box won't let me click "Add" unless I type something pointless like 0.0.0.0. I think that the gateway should be optional regardless. (It would be easier to understand what's going on if there were some feedback as to which field is wrong when "Add" is grayed out, but that's a separate issue.)
Created attachment 337511 [details] [review] 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.
Created attachment 337512 [details] [review] network: drop unneeded null-check for ip4 address The pointer has already been dereferenced. Might have made more sense to check if it's the empty string and treat that as error, but nm_utils_ipaddr_valid also returns error on empty string so lets just rely on the utility function doing the right thing here.
Second patch is just a bonus cleanup, the bug is solved by the first patch. patches tested on top of 3.22.1
Attachment 337511 [details] pushed as 898d0aa - network: allow empty ip4 default gateway Attachment 337512 [details] pushed as bb4b833 - network: drop unneeded null-check for ip4 address