The first argument for dispatcher actions is the interface name, except
for the "hostname" action, where no interface is available.
For "hostname" actions continue to pass "none", as there is no interface
available. But for device actions, it may happen that the interface name
is missing too. In this case, don't pass "none" but instead an empty
name.
g_return_val_if_fail (*out_iface == NULL, NULL);
/* Hostname changes don't require a device nor contain a connection */
- if (!strcmp (action, "hostname"))
+ if (!strcmp (action, NMD_ACTION_HOSTNAME))
goto done;
/* Connection properties */
ScriptInfo *script = g_ptr_array_index (request->scripts, request->idx);
argv[0] = script->script;
- argv[1] = request->iface ? request->iface : "none";
+ argv[1] = request->iface
+ ? request->iface
+ : (!strcmp (request->action, NMD_ACTION_HOSTNAME) ? "none" : "");
argv[2] = request->action;
argv[3] = NULL;