diff options
author | Thomas Haller <thaller@redhat.com> | 2022-06-24 12:53:05 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-06-27 08:29:26 +0200 |
commit | efca0b8fa640a8490c43cef9b03fd92b6c149180 (patch) | |
tree | abb8d87c9c6d78245a3ae542494add7561983362 | |
parent | 3628cf4805fd8c5528ebe3991be5a8383f1d00d9 (diff) | |
download | NetworkManager-efca0b8fa640a8490c43cef9b03fd92b6c149180.tar.gz |
ifcfg-rh: in get_route_attributes_string() check prefix for "lock" names
In practice, the profile probably validates, so all the
attribute names are well-known. There is thus no attribute
name that has "lock-" in the middle of the string.
Still, fix it. We want to match only at the begin of the
name.
-rw-r--r-- | src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index d3ca409cd8..c0e97afe96 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -2335,7 +2335,7 @@ get_route_attributes_string(NMIPRoute *route, int family) names[i], (lock && g_variant_get_boolean(lock)) ? "lock " : "", g_variant_get_uint32(attr)); - } else if (strstr(names[i], "lock-")) { + } else if (NM_STR_HAS_PREFIX(names[i], "lock-")) { const char *n = &(names[i])[NM_STRLEN("lock-")]; attr = nm_ip_route_get_attribute(route, n); |