After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708500 - Network settings should not require a gateway
Network settings should not require a gateway
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Network
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-20 22:26 UTC by Andy Lutomirski
Modified: 2016-11-11 16:56 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8


Attachments
network: allow empty ip4 default gateway (1.74 KB, patch)
2016-10-12 12:38 UTC, Andreas Henriksson
committed Details | Review
network: drop unneeded null-check for ip4 address (1.26 KB, patch)
2016-10-12 12:38 UTC, Andreas Henriksson
committed Details | Review

Description Andy Lutomirski 2013-09-20 22:26:14 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.)
Comment 1 Andreas Henriksson 2016-10-12 12:38:42 UTC
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.
Comment 2 Andreas Henriksson 2016-10-12 12:38:47 UTC
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.
Comment 3 Andreas Henriksson 2016-10-12 12:56:47 UTC
Second patch is just a bonus cleanup, the bug is solved by the first patch.

patches tested on top of 3.22.1
Comment 4 Bastien Nocera 2016-11-11 16:56:35 UTC
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