summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-10-06 11:58:52 +0200
committerTom Gundersen <teg@jklm.no>2015-10-06 11:58:52 +0200
commitf0990739fc24e60facb7ef0c3e97a046bd1d9d17 (patch)
treebc75b0919a966eadaafec30c40c93a3dafed6bca
parent3d366432c160c211cc99165316024df3757166ef (diff)
parent66d3752e812915a549ebee01769ee761c1495667 (diff)
downloadsystemd-f0990739fc24e60facb7ef0c3e97a046bd1d9d17.tar.gz
systemd-f0990739fc24e60facb7ef0c3e97a046bd1d9d17.tar.bz2
systemd-f0990739fc24e60facb7ef0c3e97a046bd1d9d17.zip
Merge pull request #1467 from jacob-keller/master
networkd: document ability to disable MACAddressPolicy
-rw-r--r--man/systemd.link.xml6
-rw-r--r--src/udev/net/link-config.c4
-rw-r--r--src/udev/net/link-config.h1
3 files changed, 10 insertions, 1 deletions
diff --git a/man/systemd.link.xml b/man/systemd.link.xml
index dfff785e46..7745260a39 100644
--- a/man/systemd.link.xml
+++ b/man/systemd.link.xml
@@ -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>
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 63e54db56e..4b8c5053a4 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -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);
diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h
index 9875057e84..c52db2ce55 100644
--- a/src/udev/net/link-config.h
+++ b/src/udev/net/link-config.h
@@ -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;