mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 20:40:21 +01:00
ifcfg-rh: write lock route attribute with zero value
Only specifying "lock" without a corresponding attribute shall have the meaning of "$NAME lock 0".
This commit is contained in:
parent
e54fad0886
commit
62f2c4cf20
1 changed files with 11 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue