chiark / gitweb /
networkd: link - typo
[elogind.git] / src / network / networkd-link.c
index 7cffcb48d06aea87804f9ed9b344d4bb99b5fd38..4ad0bb47f88c08536f34e72adbc5f793631eee94 100644 (file)
@@ -1074,6 +1074,7 @@ static int link_up(Link *link) {
         int r;
 
         assert(link);
+        assert(link->network);
         assert(link->manager);
         assert(link->manager->rtnl);
 
@@ -1093,6 +1094,22 @@ static int link_up(Link *link) {
                 return r;
         }
 
+        if (link->network->mac) {
+                r = sd_rtnl_message_append_ether_addr(req, IFLA_ADDRESS, link->network->mac);
+                if (r < 0) {
+                        log_link_error(link, "Could not set MAC address: %s", strerror(-r));
+                        return r;
+                }
+        }
+
+        if (link->network->mtu) {
+                r = sd_rtnl_message_append_u32(req, IFLA_MTU, link->network->mtu);
+                if (r < 0) {
+                        log_link_error(link, "Could not set MTU: %s", strerror(-r));
+                        return r;
+                }
+        }
+
         r = sd_rtnl_call_async(link->manager->rtnl, req, link_up_handler, link,
                                0, NULL);
         if (r < 0) {
@@ -1430,7 +1447,7 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message,
         } else {
                 r = link_get(m, ifindex, &link);
                 if (r < 0 || !link) {
-                        log_warning("rtnl: received address for nonexistent link (%d), ignoring", ifindex);
+                        log_warning("rtnl: received address for nonexistent link (%d), ignoring", ifindex);
                         return 0;
                 }
         }