Re: [PATCH 8/9] ifcfg: Ignore higher level configs for bonding slaves



On Wed, 2011-10-12 at 13:51 -0500, Dan Williams wrote:

> I'd rather enforce connection validity with verify() and warn the user
> if any IP config was found in the file in the ifcfg plugin.

> I'm not sure why we need a dummy config; we'd only need one check for
> it, and that's in stage3 when we start IP config, right?  In that case
> we simply skip the IPv4 config like happens when the config is disabled.
> In the end I don't have strong feelings on this; but we should certainly
> warn in ifcfg-rh if an IPv4 config is present in the ifcfg file.

I tried to implement this and it gets ugly.

IPv6 is not a problem but IPv4 undertakes everything to not be disabled.

src/settings/plugins/ifcfg-rh/reader.c:
static NMSetting *
make_ip4_setting (shvarFile *ifcfg,
[...]
if (   !tmp_ip4   && !tmp_prefix   && !tmp_netmask
    && !tmp_ip4_0 && !tmp_prefix_0 && !tmp_netmask_0
    && !tmp_ip4_1 && !tmp_prefix_1 && !tmp_netmask_1
    && !tmp_ip4_2 && !tmp_prefix_2 && !tmp_netmask_2) {
	if (valid_ip6_config)
		/* Nope, no IPv4 */
		method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
	else
		method = NM_SETTING_IP4_CONFIG_METHOD_AUTO;


Any suggestion on how to implement a no ip configuration was provided
rule in NMSettingConnection's verify()?

Also, when eth1 and eth2 are configured as bonding slaves and the ifcfg
parsing fails the interface will still be brought up automatically using
dhcp.



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