mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 19:40:12 +01:00
dispatcher: explicitly set missing interface argument for device actions
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.
This commit is contained in:
parent
388dc12b20
commit
4c80e322ae
2 changed files with 4 additions and 2 deletions
|
|
@ -349,7 +349,7 @@ nm_dispatcher_utils_construct_envp (const char *action,
|
|||
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 */
|
||||
|
|
|
|||
|
|
@ -372,7 +372,9 @@ dispatch_one_script (Request *request)
|
|||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue