From: Michael Tremer Date: Sun, 4 Jun 2023 17:09:01 +0000 (+0000) Subject: ports: Set the configure MAC address when creating links X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1574bc0061fa712150316d7bc77954f3264363f8;p=network.git ports: Set the configure MAC address when creating links Signed-off-by: Michael Tremer --- diff --git a/src/networkd/port.c b/src/networkd/port.c index c87ed599..891b8319 100644 --- a/src/networkd/port.c +++ b/src/networkd/port.c @@ -486,7 +486,14 @@ static int nw_port_create_link(nw_port* port) { goto ERROR; } - // XXX Set common things like MAC address, etc. + // XXX Set common things like MTU, etc. + + // Set MAC address + r = sd_netlink_message_append_ether_addr(m, IFLA_ADDRESS, &port->address); + if (r < 0) { + ERROR("Could not set MAC address: %s\n", strerror(-r)); + goto ERROR; + } // Fetch the parent link link = nw_port_get_parent_link(port);