]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: honor the buffer size specified in networkd.socket
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Sep 2020 15:33:11 +0000 (00:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Sep 2020 21:39:05 +0000 (06:39 +0900)
src/network/networkd-manager.c

index 1f15d588565fbc26d52c6a907d128b97dd8cb062..5ed9cce1cad966569e0e6a58233880e48a1fe173 100644 (file)
@@ -1369,9 +1369,14 @@ static int manager_connect_rtnl(Manager *m) {
         if (r < 0)
                 return r;
 
-        r = sd_netlink_inc_rcvbuf(m->rtnl, RCVBUF_SIZE);
-        if (r < 0)
-                log_warning_errno(r, "Failed to increase receive buffer size for rtnl socket, ignoring: %m");
+        /* Bump receiver buffer, but only if we are not called via socket activation, as in that
+         * case systemd sets the receive buffer size for us, and the value in the .socket unit
+         * should take full effect. */
+        if (fd < 0) {
+                r = sd_netlink_inc_rcvbuf(m->rtnl, RCVBUF_SIZE);
+                if (r < 0)
+                        log_warning_errno(r, "Failed to increase receive buffer size for rtnl socket, ignoring: %m");
+        }
 
         r = sd_netlink_attach_event(m->rtnl, m->event, 0);
         if (r < 0)