ifcfg-rh: emit a warning when DEFROUTE=no and GATEWAY is set

This commit is contained in:
Beniamino Galvani 2016-04-22 15:32:37 +02:00
parent c1907a218a
commit 5b70254ea0

View file

@ -984,6 +984,8 @@ make_ip4_setting (shvarFile *ifcfg,
goto done;
(void) nm_setting_ip_config_add_address (s_ip4, addr);
nm_ip_address_unref (addr);
if (never_default)
PARSE_WARNING ("GATEWAY will be ignored when DEFROUTE is disabled");
g_object_set (s_ip4, NM_SETTING_IP_CONFIG_GATEWAY, gateway, NULL);
}
return NM_SETTING (s_ip4);
@ -1082,6 +1084,9 @@ make_ip4_setting (shvarFile *ifcfg,
}
g_object_set (s_ip4, NM_SETTING_IP_CONFIG_GATEWAY, gateway, NULL);
if (gateway && never_default)
PARSE_WARNING ("GATEWAY will be ignored when DEFROUTE is disabled");
/* DNS servers
* Pick up just IPv4 addresses (IPv6 addresses are taken by make_ip6_setting())
*/