network/netdev: generate persistent MAC address for batadv and bridge

This mostly reverts 489f01f806 and
deb2cfa4c6.

As now MACAddress=none is supported. So, users can still disable MAC
address assignment.
This commit is contained in:
Yu Watanabe 2021-11-08 11:36:09 +09:00
parent aaa5ca57ae
commit 5b8bdd20c6
3 changed files with 5 additions and 4 deletions

View file

@ -261,10 +261,9 @@
devices, the <varname>MACAddress=</varname> setting in the [NetDev] section is not
supported and will be ignored. Please specify it in the [Link] section of the corresponding
<citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
file. If this option is not set, <literal>bridge</literal> and <literal>vlan</literal> devices
inherit the MAC address of the first slave device or the physical interface, respectively. For other
kind of netdevs, if this option is not set, then the MAC address is generated based on the interface
name and the
file. If this option is not set, <literal>vlan</literal> device inherits the MAC address of
the master interface. For other kind of netdevs, if this option is not set, then the MAC
address is generated based on the interface name and the
<citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
<para>Note, even if <literal>none</literal> is specified, <command>systemd-udevd</command>

View file

@ -203,4 +203,5 @@ const NetDevVTable batadv_vtable = {
.post_create = netdev_batadv_post_create,
.create_type = NETDEV_CREATE_MASTER,
.iftype = ARPHRD_ETHER,
.generate_mac = true,
};

View file

@ -278,4 +278,5 @@ const NetDevVTable bridge_vtable = {
.post_create = netdev_bridge_post_create,
.create_type = NETDEV_CREATE_MASTER,
.iftype = ARPHRD_ETHER,
.generate_mac = true,
};