From cfd37f2758c24de5cc84afa8ee7f9d6183e561e9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 25 Jun 2021 10:50:39 +0200 Subject: [PATCH] ifcfg: always write ethernet.s390-options even without subchannels For the umpteenth time: it is not ifcfg-rh writers decision to decide what are valid configurations and only persist settings based on some other settings. If s390-options would only be allowed together with subchannels, then this is alone nm_connection_verify()'s task to ensure. Reproduce with $ nmcli connection add type ethernet autoconnect no con-name zz ethernet.s390-options bridge_role=primary Related: https://bugzilla.redhat.com/show_bug.cgi?id=1935842 Fixes: 16bccfd672e7 ('core: handle s390 options more cleanly') (cherry picked from commit d391f20730be67fb0a38a15b57fcd00cbc02053b) (cherry picked from commit b425793d90a7e02420e7f2b7b6f3c1abd8e393c4) --- src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 65bacb293a..45b76456b5 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 @@ -1137,7 +1137,7 @@ write_wired_setting(NMConnection *connection, shvarFile *ifcfg, GError **error) svSetValueStr(ifcfg, "CTCPROT", nm_setting_wired_get_s390_option_by_key(s_wired, "ctcprot")); num_opts = nm_setting_wired_get_num_s390_options(s_wired); - if (s390_subchannels && num_opts) { + if (num_opts > 0) { nm_auto_free_gstring GString *tmp = NULL; for (i = 0; i < num_opts; i++) {