From 5b8bdd20c621dd1a34d4e5b200ef9ea1711bfb14 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 8 Nov 2021 11:36:09 +0900 Subject: [PATCH] network/netdev: generate persistent MAC address for batadv and bridge This mostly reverts 489f01f806f865eabb55458c98182b06a6c53a62 and deb2cfa4c6885d448eb1f17e5ef1b139106b7e86. As now MACAddress=none is supported. So, users can still disable MAC address assignment. --- man/systemd.netdev.xml | 7 +++---- src/network/netdev/batadv.c | 1 + src/network/netdev/bridge.c | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 133c6fcc637..bd493a8c53f 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -261,10 +261,9 @@ devices, the MACAddress= setting in the [NetDev] section is not supported and will be ignored. Please specify it in the [Link] section of the corresponding systemd.network5 - file. If this option is not set, bridge and vlan 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, vlan 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 machine-id5. Note, even if none is specified, systemd-udevd diff --git a/src/network/netdev/batadv.c b/src/network/netdev/batadv.c index f42f572a367..15f3aee3a63 100644 --- a/src/network/netdev/batadv.c +++ b/src/network/netdev/batadv.c @@ -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, }; diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c index 2d60e441ec3..64d65493caf 100644 --- a/src/network/netdev/bridge.c +++ b/src/network/netdev/bridge.c @@ -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, }; -- 2.47.3