diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-07 05:57:29 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-07 15:58:25 +0900 |
commit | 5329a37935b5b4d1fca64ddc0ba952d17c6dc587 (patch) | |
tree | db67189cc28d7e71457d490fb998e425389db644 /src/network/networkd-setlink.c | |
parent | 0ddd608a6ddcd095d378510c7096ee979741046d (diff) | |
download | systemd-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.c | 9 |
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; |