summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 7cffcb48d0..d59a8192b0 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -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) {