]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/networkd/port.c
ports: Set the configure MAC address when creating links
[people/ms/network.git] / src / networkd / port.c
index c87ed599db74c3a74af34c1fb8934f3adb6b0fb7..891b8319e9788aaf93ad4dc787658a0f254aaa12 100644 (file)
@@ -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);