mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 04:28:29 +02:00
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.
(cherry picked from commit 0b168f7b99)
This commit is contained in:
parent
02513e4b5d
commit
62b135d337
2 changed files with 7 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 <varname>hostname</varname> and <varname>connectivity-change</varname>
|
||||
actions it is always "none".
|
||||
For the <varname>hostname</varname> action the device name is always <literal>"none"</literal>
|
||||
and for <varname>connectivity-change</varname> it is empty.
|
||||
</para>
|
||||
<para>The actions are:</para>
|
||||
<variablelist class="dispatcher-options">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue