summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-09-21 19:03:08 +0200
committerThomas Haller <thaller@redhat.com>2017-09-26 19:39:36 +0200
commitc71f26bf921314c39c494a748bf6d621d488e826 (patch)
tree5ab29ffbac6b8b8ba8fca7bf1403eb04aa14b782
parenta22b01783053934a845c4600144efacb84d0b253 (diff)
downloadNetworkManager-c71f26bf921314c39c494a748bf6d621d488e826.tar.gz
libnm,cli: add IP setting "route-table-sync"
-rw-r--r--clients/common/nm-meta-setting-desc.c16
-rw-r--r--clients/common/settings-docs.c.in2
-rw-r--r--libnm-core/nm-dbus-interface.h21
-rw-r--r--libnm-core/nm-setting-ip-config.c61
-rw-r--r--libnm-core/nm-setting-ip-config.h4
-rw-r--r--libnm-core/nm-setting-ip4-config.c9
-rw-r--r--libnm-core/nm-setting-ip6-config.c9
-rw-r--r--libnm-core/tests/test-general.c1
-rw-r--r--libnm/libnm.ver2
-rw-r--r--man/NetworkManager.conf.xml8
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c4
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c14
12 files changed, 151 insertions, 0 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index 6a9ad8e34a..b6abd666d9 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -5353,6 +5353,14 @@ static const NMMetaPropertyInfo *const property_infos_IP4_CONFIG[] = {
PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTE_METRIC, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_METRIC,
.property_type = &_pt_gobject_int,
),
+ PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTE_TABLE_SYNC, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_TABLE_SYNC,
+ .property_type = &_pt_gobject_enum,
+ .property_typ_data = DEFINE_PROPERTY_TYP_DATA (
+ PROPERTY_TYP_DATA_SUBTYPE (gobject_enum,
+ .get_gtype = nm_ip_route_table_sync_mode_get_type,
+ ),
+ ),
+ ),
PROPERTY_INFO (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES,
.property_type = &_pt_gobject_bool,
),
@@ -5502,6 +5510,14 @@ static const NMMetaPropertyInfo *const property_infos_IP6_CONFIG[] = {
PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTE_METRIC, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_METRIC,
.property_type = &_pt_gobject_int,
),
+ PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTE_TABLE_SYNC, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_TABLE_SYNC,
+ .property_type = &_pt_gobject_enum,
+ .property_typ_data = DEFINE_PROPERTY_TYP_DATA (
+ PROPERTY_TYP_DATA_SUBTYPE (gobject_enum,
+ .get_gtype = nm_ip_route_table_sync_mode_get_type,
+ ),
+ ),
+ ),
PROPERTY_INFO (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES,
.property_type = &_pt_gobject_bool,
),
diff --git a/clients/common/settings-docs.c.in b/clients/common/settings-docs.c.in
index ea75781069..871a03d04a 100644
--- a/clients/common/settings-docs.c.in
+++ b/clients/common/settings-docs.c.in
@@ -224,6 +224,7 @@
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_NAME N_("The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\".")
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_NEVER_DEFAULT N_("If TRUE, this connection will never be the default connection for this IP type, meaning it will never be assigned the default route by NetworkManager.")
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.")
+#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_TABLE_SYNC N_("The mode how to sync the routes per table. In general, when NetworkManager manages a device it will remove extraneous routes from the routing tables. The sync parameter specifies which tables are synced this way. That means, from which routing table NetworkManager will remove those unexpected, extraneous routes. A value of 1 (none) means that no route tables will not be synced and no routes are removed by NetworkManager. 2 (main) means that only the main table will be synced. 3 (full) will sync all the route tables, except the local table. A value of zero is the default value and allows to be overwritten via global configuration. In absence of global configuration, the default value is 2 (main).")
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTES N_("Array of IP routes.")
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE N_("Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: \"eui64\", or \"stable-privacy\". If the property is set to \"eui64\", the addresses will be generated using the interface tokens derived from hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of \"stable-privacy\" enables use of cryptographically secure hash of a secret host-specific key along with the connection's stable-id and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. On D-Bus, the absence of an addr-gen-mode setting equals enabling \"stable-privacy\". For keyfile plugin, the absence of the setting on disk means \"eui64\" so that the property doesn't change on upgrade from older versions. Note that this setting is distinct from the Privacy Extensions as configured by \"ip6-privacy\" property and it does not affect the temporary addresses configured with this option.")
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDRESSES N_("Array of IP addresses.")
@@ -244,6 +245,7 @@
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_NAME N_("The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\".")
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_NEVER_DEFAULT N_("If TRUE, this connection will never be the default connection for this IP type, meaning it will never be assigned the default route by NetworkManager.")
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.")
+#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_TABLE_SYNC N_("The mode how to sync the routes per table. In general, when NetworkManager manages a device it will remove extraneous routes from the routing tables. The sync parameter specifies which tables are synced this way. That means, from which routing table NetworkManager will remove those unexpected, extraneous routes. A value of 1 (none) means that no route tables will not be synced and no routes are removed by NetworkManager. 2 (main) means that only the main table will be synced. 3 (full) will sync all the route tables, except the local table. A value of zero is the default value and allows to be overwritten via global configuration. In absence of global configuration, the default value is 2 (main).")
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTES N_("Array of IP routes.")
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_TOKEN N_("Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02 IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode.")
#define DESCRIBE_DOC_NM_SETTING_MACSEC_ENCRYPT N_("Whether the transmitted traffic must be encrypted.")
diff --git a/libnm-core/nm-dbus-interface.h b/libnm-core/nm-dbus-interface.h
index b089365ccc..11492def2c 100644
--- a/libnm-core/nm-dbus-interface.h
+++ b/libnm-core/nm-dbus-interface.h
@@ -856,4 +856,25 @@ typedef enum { /*< skip >*/
NM_ROLLBACK_RESULT_ERR_FAILED = 3,
} NMRollbackResult;
+/**
+ * NMIPRouteTableSyncMode:
+ * @NM_IP_ROUTE_TABLE_SYNC_MODE_DEFAULT: the default value, meaning the value
+ * is subject to global configuration default.
+ * @NM_IP_ROUTE_TABLE_SYNC_MODE_NONE: no route table is synced. This means,
+ * NetworkManager will only add routes for a particular interface to the
+ * routing tables, but not delete any routes.
+ * @NM_IP_ROUTE_TABLE_SYNC_MODE_MAIN: only the main table is synced. For all
+ * other tables, NM won't delete any extra routes.
+ * @NM_IP_ROUTE_TABLE_SYNC_MODE_FULL: NM will sync all tables, except the
+ * local table (255).
+ *
+ * Since: 1.10
+ */
+typedef enum {
+ NM_IP_ROUTE_TABLE_SYNC_MODE_DEFAULT = 0,
+ NM_IP_ROUTE_TABLE_SYNC_MODE_NONE = 1,
+ NM_IP_ROUTE_TABLE_SYNC_MODE_MAIN = 2,
+ NM_IP_ROUTE_TABLE_SYNC_MODE_FULL = 3,
+} NMIPRouteTableSyncMode;
+
#endif /* __NM_DBUS_INTERFACE_H__ */
diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c
index 3ab159b097..fc797edb43 100644
--- a/libnm-core/nm-setting-ip-config.c
+++ b/libnm-core/nm-setting-ip-config.c
@@ -1378,6 +1378,7 @@ typedef struct {
gboolean may_fail;
gint dad_timeout;
gint dhcp_timeout;
+ int route_table_sync;
} NMSettingIPConfigPrivate;
enum {
@@ -1399,6 +1400,7 @@ enum {
PROP_MAY_FAIL,
PROP_DAD_TIMEOUT,
PROP_DHCP_TIMEOUT,
+ PROP_ROUTE_TABLE_SYNC,
LAST_PROP
};
@@ -2250,6 +2252,24 @@ nm_setting_ip_config_get_route_metric (NMSettingIPConfig *setting)
return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->route_metric;
}
+/**
+ * nm_setting_ip_config_get_route_table_sync:
+ * @setting: the #NMSettingIPConfig
+ *
+ * Returns the value contained in the #NMSettingIPConfig:route-table-sync
+ * property.
+ *
+ * Returns: the configured route-table-sync mode.
+ *
+ * Since: 1.10
+ **/
+NMIPRouteTableSyncMode
+nm_setting_ip_config_get_route_table_sync (NMSettingIPConfig *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), 0);
+
+ return NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->route_table_sync;
+}
/**
* nm_setting_ip_config_get_ignore_auto_routes:
@@ -2513,6 +2533,17 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
}
}
+ if ( priv->route_table_sync < NM_IP_ROUTE_TABLE_SYNC_MODE_DEFAULT
+ || priv->route_table_sync > NM_IP_ROUTE_TABLE_SYNC_MODE_FULL) {
+ g_set_error (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("invalid route table sync value %d"),
+ priv->route_table_sync);
+ g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), NM_SETTING_IP_CONFIG_ROUTE_TABLE_SYNC);
+ return FALSE;
+ }
+
/* Validate routes */
for (i = 0; i < priv->routes->len; i++) {
NMIPRoute *route = (NMIPRoute *) priv->routes->pdata[i];
@@ -2716,6 +2747,9 @@ set_property (GObject *object, guint prop_id,
case PROP_DHCP_TIMEOUT:
priv->dhcp_timeout = g_value_get_int (value);
break;
+ case PROP_ROUTE_TABLE_SYNC:
+ priv->route_table_sync = g_value_get_int (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -2785,6 +2819,9 @@ get_property (GObject *object, guint prop_id,
case PROP_DHCP_TIMEOUT:
g_value_set_int (value, nm_setting_ip_config_get_dhcp_timeout (setting));
break;
+ case PROP_ROUTE_TABLE_SYNC:
+ g_value_set_int (value, priv->route_table_sync);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -3127,6 +3164,7 @@ nm_setting_ip_config_class_init (NMSettingIPConfigClass *setting_class)
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_FUZZY_IGNORE |
G_PARAM_STATIC_STRINGS));
+
/**
* NMSettingIPConfig:dhcp-timeout:
*
@@ -3139,4 +3177,27 @@ nm_setting_ip_config_class_init (NMSettingIPConfigClass *setting_class)
G_PARAM_READWRITE |
NM_SETTING_PARAM_FUZZY_IGNORE |
G_PARAM_STATIC_STRINGS));
+
+ /**
+ * NMSettingIPConfig:route-table-sync:
+ *
+ * The mode how to sync the routes per table. In general, when NetworkManager manages
+ * a device it will remove extraneous routes from the routing tables. The
+ * sync parameter specifies which tables are synced this way. That means, from
+ * which routing table NetworkManager will remove those unexpected, extraneous routes.
+ * A value of 1 (none) means that no route tables will not be synced and no routes
+ * are removed by NetworkManager. 2 (main) means that only the main table will be synced.
+ * 3 (full) will sync all the route tables, except the local table. A value of zero is
+ * the default value and allows to be overwritten via global configuration. In absence of
+ * global configuration, the default value is 2 (main).
+ *
+ * Since: 1.10
+ **/
+ g_object_class_install_property
+ (object_class, PROP_ROUTE_TABLE_SYNC,
+ g_param_spec_int (NM_SETTING_IP_CONFIG_ROUTE_TABLE_SYNC, "", "",
+ G_MININT32, G_MAXINT32, NM_IP_ROUTE_TABLE_SYNC_MODE_DEFAULT,
+ G_PARAM_READWRITE |
+ NM_SETTING_PARAM_FUZZY_IGNORE |
+ G_PARAM_STATIC_STRINGS));
}
diff --git a/libnm-core/nm-setting-ip-config.h b/libnm-core/nm-setting-ip-config.h
index b7bb021542..c933c28735 100644
--- a/libnm-core/nm-setting-ip-config.h
+++ b/libnm-core/nm-setting-ip-config.h
@@ -171,6 +171,7 @@ gboolean nm_ip_route_attribute_validate (const char *name,
#define NM_SETTING_IP_CONFIG_MAY_FAIL "may-fail"
#define NM_SETTING_IP_CONFIG_DAD_TIMEOUT "dad-timeout"
#define NM_SETTING_IP_CONFIG_DHCP_TIMEOUT "dhcp-timeout"
+#define NM_SETTING_IP_CONFIG_ROUTE_TABLE_SYNC "route-table-sync"
#define NM_SETTING_DNS_OPTION_DEBUG "debug"
#define NM_SETTING_DNS_OPTION_NDOTS "ndots"
@@ -284,6 +285,9 @@ gint nm_setting_ip_config_get_dad_timeout (NMSettingIPConfig
NM_AVAILABLE_IN_1_2
gint nm_setting_ip_config_get_dhcp_timeout (NMSettingIPConfig *setting);
+NM_AVAILABLE_IN_1_10
+NMIPRouteTableSyncMode nm_setting_ip_config_get_route_table_sync (NMSettingIPConfig *setting);
+
G_END_DECLS
#endif /* NM_SETTING_IP_CONFIG_H */
diff --git a/libnm-core/nm-setting-ip4-config.c b/libnm-core/nm-setting-ip4-config.c
index 3b17ba16a9..7c3cddd6f3 100644
--- a/libnm-core/nm-setting-ip4-config.c
+++ b/libnm-core/nm-setting-ip4-config.c
@@ -681,6 +681,15 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *ip4_class)
*/
/* ---ifcfg-rh---
+ * property: route-table-sync
+ * variable: IPV4_ROUTE_TABLE_SYNC(+)
+ * default: 0
+ * description: IPV4_ROUTE_TABLE_SYNC controls how NetworkManager removes extraneous
+ * routes from the routing tables.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
* property: dns-priority
* variable: IPV4_DNS_PRIORITY(+)
* description: The priority for DNS servers of this connection. Lower values have higher priority.
diff --git a/libnm-core/nm-setting-ip6-config.c b/libnm-core/nm-setting-ip6-config.c
index 9850c8eaa0..7ebb3df8c9 100644
--- a/libnm-core/nm-setting-ip6-config.c
+++ b/libnm-core/nm-setting-ip6-config.c
@@ -653,6 +653,15 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *ip6_class)
*/
/* ---ifcfg-rh---
+ * property: route-table-sync
+ * variable: IPV6_ROUTE_TABLE_SYNC(+)
+ * default: 0
+ * description: IPV6_ROUTE_TABLE_SYNC controls how NetworkManager removes extraneous
+ * routes from the routing tables.
+ * ---end---
+ */
+
+ /* ---ifcfg-rh---
* property: dns-priority
* variable: IPV6_DNS_PRIORITY(+)
* description: The priority for DNS servers of this connection. Lower values have higher priority.
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c
index e977e418fe..67d530e820 100644
--- a/libnm-core/tests/test-general.c
+++ b/libnm-core/tests/test-general.c
@@ -2479,6 +2479,7 @@ test_connection_diff_a_only (void)
{ NM_SETTING_IP_CONFIG_GATEWAY, NM_SETTING_DIFF_RESULT_IN_A },
{ NM_SETTING_IP_CONFIG_ROUTES, NM_SETTING_DIFF_RESULT_IN_A },
{ NM_SETTING_IP_CONFIG_ROUTE_METRIC, NM_SETTING_DIFF_RESULT_IN_A },
+ { NM_SETTING_IP_CONFIG_ROUTE_TABLE_SYNC, NM_SETTING_DIFF_RESULT_IN_A },
{ NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, NM_SETTING_DIFF_RESULT_IN_A },
{ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, NM_SETTING_DIFF_RESULT_IN_A },
{ NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, NM_SETTING_DIFF_RESULT_IN_A },
diff --git a/libnm/libnm.ver b/libnm/libnm.ver
index f212f0f47d..a2b8be52ef 100644
--- a/libnm/libnm.ver
+++ b/libnm/libnm.ver
@@ -1185,7 +1185,9 @@ global:
nm_client_connectivity_check_set_enabled;
nm_device_dummy_get_hw_address;
nm_device_ppp_get_type;
+ nm_ip_route_table_sync_mode_get_type;
nm_setting_bridge_get_group_forward_mask;
+ nm_setting_ip_config_get_route_table_sync;
nm_setting_pppoe_get_parent;
nm_setting_wireless_security_get_pmf;
nm_setting_wireless_security_get_wps_method;
diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml
index 25fe1ba4d4..52267b95be 100644
--- a/man/NetworkManager.conf.xml
+++ b/man/NetworkManager.conf.xml
@@ -683,6 +683,10 @@ ipv6.ip6-privacy=0
<term><varname>ipv4.route-metric</varname></term>
</varlistentry>
<varlistentry>
+ <term><varname>ipv4.route-table-sync</varname></term>
+ <listitem><para>If left unspecified, the default value is 2 (main).</para></listitem>
+ </varlistentry>
+ <varlistentry>
<term><varname>ipv6.dhcp-timeout</varname></term>
<listitem><para>If left unspecified, the default value for
the interface type is used.</para></listitem>
@@ -697,6 +701,10 @@ ipv6.ip6-privacy=0
<term><varname>ipv6.route-metric</varname></term>
</varlistentry>
<varlistentry>
+ <term><varname>ipv6.route-table-sync</varname></term>
+ <listitem><para>If left unspecified, the default value is 2 (main).</para></listitem>
+ </varlistentry>
+ <varlistentry>
<term><varname>vpn.timeout</varname></term>
<listitem><para>If left unspecified, default value of 60 seconds is used.</para></listitem>
</varlistentry>
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
index 877ce13d68..dc2c408906 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
@@ -1277,6 +1277,8 @@ make_ip4_setting (shvarFile *ifcfg,
NM_SETTING_IP_CONFIG_MAY_FAIL, !svGetValueBoolean (ifcfg, "IPV4_FAILURE_FATAL", FALSE),
NM_SETTING_IP_CONFIG_ROUTE_METRIC, svGetValueInt64 (ifcfg, "IPV4_ROUTE_METRIC", 10,
-1, G_MAXUINT32, -1),
+ NM_SETTING_IP_CONFIG_ROUTE_TABLE_SYNC, (int) svGetValueInt64 (ifcfg, "IPV4_ROUTE_TABLE_SYNC", 10,
+ G_MININT32, G_MAXINT32, NM_IP_ROUTE_TABLE_SYNC_MODE_DEFAULT),
NULL);
if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0)
@@ -1707,6 +1709,8 @@ make_ip6_setting (shvarFile *ifcfg,
NM_SETTING_IP_CONFIG_MAY_FAIL, !svGetValueBoolean (ifcfg, "IPV6_FAILURE_FATAL", FALSE),
NM_SETTING_IP_CONFIG_ROUTE_METRIC, svGetValueInt64 (ifcfg, "IPV6_ROUTE_METRIC", 10,
-1, G_MAXUINT32, -1),
+ NM_SETTING_IP_CONFIG_ROUTE_TABLE_SYNC, (int) svGetValueInt64 (ifcfg, "IPV6_ROUTE_TABLE_SYNC", 10,
+ G_MININT32, G_MAXINT32, NM_IP_ROUTE_TABLE_SYNC_MODE_DEFAULT),
NM_SETTING_IP6_CONFIG_IP6_PRIVACY, ip6_privacy_val,
NULL);
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
index ad2b9d04c3..658526abe9 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
@@ -2021,6 +2021,7 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
gint j;
guint i, num, n;
gint64 route_metric;
+ NMIPRouteTableSyncMode route_table_sync;
gint priority;
int timeout;
GString *searches;
@@ -2215,6 +2216,12 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
svSetValueStr (ifcfg, "IPV4_ROUTE_METRIC", tmp);
g_free (tmp);
+ route_table_sync = nm_setting_ip_config_get_route_table_sync (s_ip4);
+ svSetValueInt64_cond (ifcfg,
+ "IPV4_ROUTE_TABLE_SYNC",
+ route_table_sync != NM_IP_ROUTE_TABLE_SYNC_MODE_DEFAULT,
+ route_table_sync);
+
/* Static routes - route-<name> file */
route_path = utils_get_route_path (svFileGetName (ifcfg));
if (!route_path) {
@@ -2482,6 +2489,7 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
NMIPAddress *addr;
const char *dns;
gint64 route_metric;
+ NMIPRouteTableSyncMode route_table_sync;
GString *ip_str1, *ip_str2, *ip_ptr;
char *route6_path;
NMSettingIP6ConfigAddrGenMode addr_gen_mode;
@@ -2614,6 +2622,12 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
svSetValueStr (ifcfg, "IPV6_ROUTE_METRIC", tmp);
g_free (tmp);
+ route_table_sync = nm_setting_ip_config_get_route_table_sync (s_ip6);
+ svSetValueInt64_cond (ifcfg,
+ "IPV6_ROUTE_TABLE_SYNC",
+ route_table_sync != NM_IP_ROUTE_TABLE_SYNC_MODE_DEFAULT,
+ route_table_sync);
+
/* IPv6 Privacy Extensions */
svUnsetValue (ifcfg, "IPV6_PRIVACY");
svUnsetValue (ifcfg, "IPV6_PRIVACY_PREFER_PUBLIC_IP");