summaryrefslogtreecommitdiff
path: root/dispatcher
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-04-29 09:47:06 +0200
committerThomas Haller <thaller@redhat.com>2020-04-30 21:50:28 +0200
commit0b168f7b995e0eac681a985e69f0f036c8db15c4 (patch)
tree8c6cc475d3239ade4f95af132ae948ecbbad6f5c /dispatcher
parente468b48ab7b8e2ddc8802db4b93e3f13787835e4 (diff)
downloadNetworkManager-0b168f7b995e0eac681a985e69f0f036c8db15c4.tar.gz
dispatcher: clarify documentation about first argument to dispatcher scripts for "connectivity-change"
The manual page claimed that for "connectivitiy-change" actions, the dispatcher scripts would get as first argument (the device name) "none". That was not done, only for "hostname" actions. For consistency, maybe that should be adjusted to also pass "none" for connectivity change events. However, "none" is really an odd value, if there is no device. Passing an empty word is IMO nicer. So stick to that behavior, despite being inconsistent. Also fix the documentation about that.
Diffstat (limited to 'dispatcher')
-rw-r--r--dispatcher/nm-dispatcher.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dispatcher/nm-dispatcher.c b/dispatcher/nm-dispatcher.c
index 27647c1b64..55656cf7b5 100644
--- a/dispatcher/nm-dispatcher.c
+++ b/dispatcher/nm-dispatcher.c
@@ -491,8 +491,12 @@ script_dispatch (ScriptInfo *script)
script->dispatched = TRUE;
+ /* Only for "hostname" action we coerce the interface name to "none". We don't
+ * do so for "connectivity-check" action. */
+
argv[0] = script->script;
- argv[1] = request->iface ?: (!strcmp(request->action, NMD_ACTION_HOSTNAME) ? "none" : "");
+ argv[1] = request->iface
+ ?: (nm_streq (request->action, NMD_ACTION_HOSTNAME) ? "none" : "");
argv[2] = request->action;
argv[3] = NULL;