summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-setlink.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-11-08 04:19:56 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-12-04 16:19:01 +0100
commitc3747f90b1a4fa74a6a88dd50f98c871ae35ea7c (patch)
tree046673a01d181cbae5c121da4a6c8801102b97bf /src/network/networkd-setlink.c
parentnetwork: add support to configure IPoIB interfaces (diff)
downloadsystemd-c3747f90b1a4fa74a6a88dd50f98c871ae35ea7c.tar.xz
systemd-c3747f90b1a4fa74a6a88dd50f98c871ae35ea7c.zip
network: set MTU after IPoIB configs are applied
MTU is updated when IB mode is changed.
Diffstat (limited to '')
-rw-r--r--src/network/networkd-setlink.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c
index d32dc81794..177c054f46 100644
--- a/src/network/networkd-setlink.c
+++ b/src/network/networkd-setlink.c
@@ -518,6 +518,9 @@ static bool link_is_ready_to_call_set_link(Request *req) {
int r;
assert(req);
+ assert(req->link);
+ assert(req->link->manager);
+ assert(req->link->network);
link = req->link;
op = PTR_TO_INT(req->set_link_operation_ptr);
@@ -566,8 +569,6 @@ static bool link_is_ready_to_call_set_link(Request *req) {
case SET_LINK_MASTER: {
uint32_t m = 0;
- assert(link->network);
-
if (link->network->batadv) {
if (!netdev_is_ready(link->network->batadv))
return false;
@@ -600,6 +601,15 @@ static bool link_is_ready_to_call_set_link(Request *req) {
req->userdata = UINT32_TO_PTR(m);
break;
}
+ case SET_LINK_MTU: {
+ Request req_ipoib = {
+ .link = link,
+ .type = REQUEST_TYPE_SET_LINK,
+ .set_link_operation_ptr = INT_TO_PTR(SET_LINK_IPOIB),
+ };
+
+ return !ordered_set_contains(link->manager->request_queue, &req_ipoib);
+ }
default:
break;
}