summaryrefslogtreecommitdiff
path: root/src/network/networkd-setlink.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-07 05:57:29 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-12-07 15:58:25 +0900
commit5329a37935b5b4d1fca64ddc0ba952d17c6dc587 (patch)
treedb67189cc28d7e71457d490fb998e425389db644 /src/network/networkd-setlink.c
parent0ddd608a6ddcd095d378510c7096ee979741046d (diff)
downloadsystemd-5329a37935b5b4d1fca64ddc0ba952d17c6dc587.tar.gz
network: set MAC address before enslaving to bond or bridge interface
As the master interface may inherit the slave MAC address.
Diffstat (limited to 'src/network/networkd-setlink.c')
-rw-r--r--src/network/networkd-setlink.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c
index ff4eecf9b3..77451e39ae 100644
--- a/src/network/networkd-setlink.c
+++ b/src/network/networkd-setlink.c
@@ -568,12 +568,19 @@ static bool link_is_ready_to_call_set_link(Request *req) {
break;
case SET_LINK_MASTER: {
uint32_t m = 0;
+ Request req_mac = {
+ .link = link,
+ .type = REQUEST_TYPE_SET_LINK,
+ .set_link_operation_ptr = INT_TO_PTR(SET_LINK_MAC),
+ };
if (link->network->batadv) {
if (!netdev_is_ready(link->network->batadv))
return false;
m = link->network->batadv->ifindex;
} else if (link->network->bond) {
+ if (ordered_set_contains(link->manager->request_queue, &req_mac))
+ return false;
if (!netdev_is_ready(link->network->bond))
return false;
m = link->network->bond->ifindex;
@@ -589,6 +596,8 @@ static bool link_is_ready_to_call_set_link(Request *req) {
}
}
} else if (link->network->bridge) {
+ if (ordered_set_contains(link->manager->request_queue, &req_mac))
+ return false;
if (!netdev_is_ready(link->network->bridge))
return false;
m = link->network->bridge->ifindex;