]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: set MTU after IPoIB configs are applied
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 Nov 2021 03:19:56 +0000 (12:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 4 Dec 2021 15:19:01 +0000 (00:19 +0900)
MTU is updated when IB mode is changed.

src/network/networkd-setlink.c

index d32dc81794cdd4b5d122e9153941da90d0abb701..177c054f463951df3f980b81f65637ce9d440398 100644 (file)
@@ -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;
         }