mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 07:40:28 +01:00
ifcfg-rh: write [IPV6_]PEERDNS and [IPV6_]PEERROUTES only when they are "no"
When those values are missing they are already considered as TRUE. As they are written also when DHCP is not enabled, write them only if they have a value different from the default.
This commit is contained in:
parent
dbb9cd3ca8
commit
08bd3feed0
1 changed files with 8 additions and 6 deletions
|
|
@ -2172,10 +2172,12 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||
/* DEFROUTE; remember that it has the opposite meaning from never-default */
|
||||
svSetValueBoolean (ifcfg, "DEFROUTE", !nm_setting_ip_config_get_never_default (s_ip4));
|
||||
|
||||
svUnsetValue (ifcfg, "PEERDNS");
|
||||
svUnsetValue (ifcfg, "PEERROUTES");
|
||||
svSetValueBoolean (ifcfg, "PEERDNS", !nm_setting_ip_config_get_ignore_auto_dns (s_ip4));
|
||||
svSetValueBoolean (ifcfg, "PEERROUTES", !nm_setting_ip_config_get_ignore_auto_routes (s_ip4));
|
||||
/* Missing PEERDNS means TRUE, so write it only when is FALSE */
|
||||
svSetValueString (ifcfg, "PEERDNS",
|
||||
nm_setting_ip_config_get_ignore_auto_dns (s_ip4) ? "no" : NULL);
|
||||
/* Missing PEERROUTES means TRUE, so write it only when is FALSE */
|
||||
svSetValueString (ifcfg, "PEERROUTES",
|
||||
nm_setting_ip_config_get_ignore_auto_routes (s_ip4) ? "no" : NULL);
|
||||
|
||||
value = nm_setting_ip_config_get_dhcp_hostname (s_ip4);
|
||||
svSetValueString (ifcfg, "DHCP_HOSTNAME", value);
|
||||
|
|
@ -2572,10 +2574,10 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||
svSetValueString (ifcfg, "IPV6_DEFROUTE", "yes");
|
||||
|
||||
svSetValueString (ifcfg, "IPV6_PEERDNS",
|
||||
nm_setting_ip_config_get_ignore_auto_dns (s_ip6) ? "no" : "yes");
|
||||
nm_setting_ip_config_get_ignore_auto_dns (s_ip6) ? "no" : NULL);
|
||||
|
||||
svSetValueString (ifcfg, "IPV6_PEERROUTES",
|
||||
nm_setting_ip_config_get_ignore_auto_routes (s_ip6) ? "no" : "yes");
|
||||
nm_setting_ip_config_get_ignore_auto_routes (s_ip6) ? "no" : NULL);
|
||||
|
||||
svSetValueString (ifcfg, "IPV6_FAILURE_FATAL",
|
||||
nm_setting_ip_config_get_may_fail (s_ip6) ? "no" : "yes");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue