summaryrefslogtreecommitdiffstats
path: root/src/network/netdev/vxlan.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-11-13 03:44:46 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-11-14 02:15:44 +0100
commit09db4106064dd600c64d12a4e06bd88143b2e4f7 (patch)
treee20be6a64afca7d7a4f1e872e8db78b2ea017fed /src/network/netdev/vxlan.c
parentnetwork/netdev: set interface name only when creating a new netdev (diff)
downloadsystemd-09db4106064dd600c64d12a4e06bd88143b2e4f7.tar.xz
systemd-09db4106064dd600c64d12a4e06bd88143b2e4f7.zip
network/netdev: do not update MAC address if netdev is already running
Follow-up for 17c5337f7b2993619d84acc2088b2ba1789e6477. Older kernels (older than v6.5) refuse RTM_NEWLINK messages with IFLA_ADDRESS attribute when the netdev already exists and is running, even if the MAC address is unchanged. So, let's not set IFLA_ADDRESS or IFLA_MTU if they are unchanged, and set the attributes only when we can update them.
Diffstat (limited to '')
-rw-r--r--src/network/netdev/vxlan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c
index 9f22794d34..d8a066370d 100644
--- a/src/network/netdev/vxlan.c
+++ b/src/network/netdev/vxlan.c
@@ -197,6 +197,10 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netli
return 0;
}
+static bool vxlan_can_set_mac(NetDev *netdev, const struct hw_addr_data *hw_addr) {
+ return true;
+}
+
static bool vxlan_can_set_mtu(NetDev *netdev, uint32_t mtu) {
assert(netdev);
@@ -452,6 +456,7 @@ const NetDevVTable vxlan_vtable = {
.create_type = NETDEV_CREATE_STACKED,
.is_ready_to_create = netdev_vxlan_is_ready_to_create,
.config_verify = netdev_vxlan_verify,
+ .can_set_mac = vxlan_can_set_mac,
.can_set_mtu = vxlan_can_set_mtu,
.needs_reconfigure = vxlan_needs_reconfigure,
.iftype = ARPHRD_ETHER,