mirror of
https://github.com/systemd/systemd.git
synced 2024-11-28 12:53:36 +08:00
document ability to disable MACAddressPolicy
While it is currently possible to either not set MACAddressPolicy or set it to a value different from "persistent" or "random", it is not obvious that a user can do so. Add a policy, "none", which simply retains kernel MAC addresses (same as not filling in the policy at all) and document it so that users are aware of this setting. Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
This commit is contained in:
parent
c51abd80cf
commit
66d3752e81
@ -233,6 +233,12 @@
|
||||
<literal>locally administered</literal> bits set.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>none</literal></term>
|
||||
<listitem>
|
||||
<para>Keeps the MAC address assigned by the kernel.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -460,6 +460,7 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
|
||||
mac = &generated_mac;
|
||||
}
|
||||
break;
|
||||
case MACPOLICY_NONE:
|
||||
default:
|
||||
mac = config->mac;
|
||||
}
|
||||
@ -492,7 +493,8 @@ int link_get_driver(link_config_ctx *ctx, struct udev_device *device, char **ret
|
||||
|
||||
static const char* const mac_policy_table[_MACPOLICY_MAX] = {
|
||||
[MACPOLICY_PERSISTENT] = "persistent",
|
||||
[MACPOLICY_RANDOM] = "random"
|
||||
[MACPOLICY_RANDOM] = "random",
|
||||
[MACPOLICY_NONE] = "none"
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(mac_policy, MACPolicy);
|
||||
|
@ -32,6 +32,7 @@ typedef struct link_config link_config;
|
||||
typedef enum MACPolicy {
|
||||
MACPOLICY_PERSISTENT,
|
||||
MACPOLICY_RANDOM,
|
||||
MACPOLICY_NONE,
|
||||
_MACPOLICY_MAX,
|
||||
_MACPOLICY_INVALID = -1
|
||||
} MACPolicy;
|
||||
|
Loading…
Reference in New Issue
Block a user