summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-05-12 09:35:08 +0200
committerThomas Haller <thaller@redhat.com>2020-05-12 09:39:51 +0200
commitb7a2e73bd26b3d48a6a083ff73882afcfa1be228 (patch)
tree9bfd9e3061471231f91dca3f2335d7286ea2e7b6 /src
parent755c3af91588367b4c76d6f860144548de185a34 (diff)
downloadNetworkManager-b7a2e73bd26b3d48a6a083ff73882afcfa1be228.tar.gz
core: add FIXME(release-blocker) comments for match.kernel-command-line behavior
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/431#note_490830
Diffstat (limited to 'src')
-rw-r--r--src/devices/nm-device.c22
-rw-r--r--src/nm-core-utils.c2
2 files changed, 23 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 44e5183ec2..fb926c945d 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -6099,6 +6099,28 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError **
proc_cmdline_i++;
}
+ /* FIXME(release-blocker): match.interface-name and match.driver have the meaning,
+ * that any of the matches may yield success. For match.kernel-command-line, we
+ * do here that all must match. This inconsistency is undesired.
+ *
+ * 1) improve gtk-doc documentation explaining how these options match.
+ *
+ * 2) possibly unify the behavior so that kernel-command-line behaves like other
+ * matches (and ANY may match). Note that this would be contrary to systemd's
+ * Conditions, which by default requires that ALL conditions match (AND). We
+ * should be consistent within our match options, and not with systemd here.
+ *
+ * 2b) Note that systemd supports special token like "=|", to indicate that
+ * ANY behavior. If we want, we could also introduce two special prefixes
+ * "&..." and "|...", to support either. It's slightly complicated how
+ * these work in combinations with "!".
+ * Unless we fully decide what we do about this, NMSettingMatch.verify() should
+ * reject matches that start with '&' or '|', because these will be reserved for
+ * future use.
+ *
+ * 3) while fixing this, this code should move to a separate function so we
+ * can unit test the match of kernel command lines.
+ */
if ( pos_patterns
&& !found) {
/* positive patterns configured but no match */
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
index 415e1dc415..86ba360c45 100644
--- a/src/nm-core-utils.c
+++ b/src/nm-core-utils.c
@@ -2780,7 +2780,7 @@ again:
if (G_UNLIKELY (!proc_cmdline)) {
gs_free const char **split = NULL;
- /* TODO: support quotation, like systemd's proc_cmdline_extract_first().
+ /* FIXME(release-blocker): support quotation, like systemd's proc_cmdline_extract_first().
* For that, add a new NMUtilsStrsplitSetFlags flag. */
split = nm_utils_strsplit_set_full (nm_utils_proc_cmdline (),
NM_ASCII_WHITESPACES,