summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-09-15 18:33:44 +0200
committerThomas Haller <thaller@redhat.com>2017-09-18 20:14:09 +0200
commit62f2c4cf20b02017742968a3aba493f92c9d9d3d (patch)
tree4eebdd6138095dbad15352c7d7b46946055b6ddf
parente54fad0886ddba43b89237cff4157a0c187e4948 (diff)
downloadNetworkManager-62f2c4cf20b02017742968a3aba493f92c9d9d3d.tar.gz
ifcfg-rh: write lock route attribute with zero value
Only specifying "lock" without a corresponding attribute shall have the meaning of "$NAME lock 0".
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c12
1 files changed, 11 insertions, 1 deletions
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 c1b927aadf..2f4c58e040 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
@@ -1891,7 +1891,17 @@ get_route_attributes_string (NMIPRoute *route, int family)
(lock && g_variant_get_boolean (lock)) ? "lock " : "",
g_variant_get_uint32 (attr));
} else if (strstr (names[i], "lock-")) {
- /* handled above */
+ const char *n = &(names[i])[NM_STRLEN ("lock-")];
+
+ attr = nm_ip_route_get_attribute (route, n);
+ if (!attr) {
+ g_string_append_printf (str,
+ "%s lock 0",
+ n);
+ } else {
+ /* we also have a corresponding attribute with the numeric value. The
+ * lock setting is handled above. */
+ }
} else if (nm_streq (names[i], NM_IP_ROUTE_ATTRIBUTE_TOS)) {
g_string_append_printf (str, "%s 0x%02x", names[i], (unsigned) g_variant_get_byte (attr));
} else if ( nm_streq (names[i], NM_IP_ROUTE_ATTRIBUTE_SRC)