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;
diff --git a/man/NetworkManager.xml b/man/NetworkManager.xml
index 2a13671b06..a04fec8eba 100644
--- a/man/NetworkManager.xml
+++ b/man/NetworkManager.xml
@@ -80,8 +80,8 @@
device an operation just happened on, and second the action. For device actions,
the interface is the name of the kernel interface suitable for IP configuration.
Thus it is either VPN_IP_IFACE, DEVICE_IP_IFACE, or DEVICE_IFACE, as applicable.
- For the hostname and connectivity-change
- actions it is always "none".
+ For the hostname action the device name is always "none"
+ and for connectivity-change it is empty.
The actions are: