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 708875 - Don't warn about ignoring non-existent slave IP config
Don't warn about ignoring non-existent slave IP config
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: Distro-specific
unspecified
Other All
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-09-26 21:06 UTC by Dan Winship
Modified: 2013-10-14 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ifcfg-rh: fix handling of minimal ifcfg files (8.32 KB, patch)
2013-09-26 21:06 UTC, Dan Winship
none Details | Review
ifcfg-rh: don't warn about ignoring non-existent slave IP config (5.80 KB, patch)
2013-09-26 21:06 UTC, Dan Winship
none Details | Review
settings: make connections always have s_ip4 and s_ip6 (22.38 KB, patch)
2013-09-27 14:16 UTC, Dan Winship
none Details | Review
ifcfg-rh: fix handling of minimal ifcfg files (8.23 KB, patch)
2013-09-27 14:16 UTC, Dan Winship
none Details | Review

Description Dan Winship 2013-09-26 21:06:21 UTC
ifcfg-rh *always* warns that it's ignore a slave's IP config, even
when there is no IP config.

first patch is a drive-by code simplification

also available at danw/ipwarning
Comment 1 Dan Winship 2013-09-26 21:06:23 UTC
Created attachment 255883 [details] [review]
ifcfg-rh: fix handling of minimal ifcfg files

ifcfg-rh had the rule that if an ifcfg file had no BOOTPROTO and no
IPv4 addresses, then it should be treated as BOOTPROTO=dhcp for
compatibility. But in fact, current ifup treats it as BOOTPROTO=none,
so we should too.
Comment 2 Dan Winship 2013-09-26 21:06:25 UTC
Created attachment 255884 [details] [review]
ifcfg-rh: don't warn about ignoring non-existent slave IP config

connection_from_file() warns if a slave connection has any IP4 or IP6
config, but make_ip4_setting() and make_ip6_setting() would always
return a setting (possibly with method=DISABLED/IGNORE) unless there
was a parse error. So this meant the warning would get printed even if
the file had no IP config. Fix that.
Comment 3 Dan Winship 2013-09-27 14:16:20 UTC
Created attachment 255936 [details] [review]
settings: make connections always have s_ip4 and s_ip6

Make sure that all connections returned from NMSettings have an
NMSettingIP4Config and an NMSettingIP6Config (so we don't need to
special-case NULL elsewhere), and move the slaves-can't-have-IP-config
checks into the platform-independent code as well.

This also gets rid of spurious "ignoring IP4/IP6 configuration"
warnings in ifcfg-rh when reading a slave ifcfg file.

Partly based on a patch from Pavel.
Comment 4 Dan Winship 2013-09-27 14:16:34 UTC
Created attachment 255937 [details] [review]
ifcfg-rh: fix handling of minimal ifcfg files

ifcfg-rh had the rule that if an ifcfg file had no BOOTPROTO and no
IPv4 addresses, then it should be treated as method=auto for
compatibility. But in fact, current ifup treats it as method=disabled,
so we should too.
Comment 5 Pavel Simerda 2013-09-30 10:03:29 UTC
Review of attachment 255936 [details] [review]:

Looks good except NetworkManagerUtils.c could be removed from the patch (whitespace-only change).
Comment 6 Dan Winship 2013-09-30 10:42:07 UTC
(In reply to comment #5)
> Looks good except NetworkManagerUtils.c could be removed from the patch
> (whitespace-only change).

oops, yeah, that was leftover from an earlier version of the patch where the normalize function was in that file instead of nm-settings-utils.c
Comment 7 Dan Winship 2013-10-08 18:04:40 UTC
Comment on attachment 255937 [details] [review]
ifcfg-rh: fix handling of minimal ifcfg files

the branch now has newer code than this
Comment 8 Dan Winship 2013-10-11 17:16:10 UTC
Thomas reviewed this as part of bug 700414
Comment 9 Dan Winship 2013-10-14 14:59:02 UTC
Jiri pointed out that always having IP4 and IP6 configs made some other things weird. Eg, nmcli would show the full NMSettingIP4Config and NMSettingIP6Config, and connections saved by the keyfile plugin might also show some ip4/ip6 properties set that would not be meaningful.

I've pushed a new danw/ipwarning that updates things so that slaves are now guaranteed to not have ip configs, and everything else is guaranteed to have them.
Comment 10 Jiri Klimes 2013-10-14 15:33:19 UTC
The patch looks good to me.
Comment 11 Dan Winship 2013-10-14 16:16:06 UTC
fixed