]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: assume that the recv buffer size of the netlink socket is already configured...
authorFranck Bui <fbui@suse.com>
Tue, 28 Jan 2020 15:22:12 +0000 (16:22 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 28 Jan 2020 21:35:08 +0000 (22:35 +0100)
This makes ReceiveBuffer= option in systemd-udevd-kernel.socket unit useful.

src/udev/udevd.c

index 7678331897f5e988a66ef2dba903433fae518091..ca65474f27634a880ad4381ddc9ef446ae387877 100644 (file)
@@ -1577,7 +1577,11 @@ static int manager_new(Manager **ret, int fd_ctrl, int fd_uevent, const char *cg
         if (r < 0)
                 return log_error_errno(r, "Failed to initialize device monitor: %m");
 
-        (void) sd_device_monitor_set_receive_buffer_size(manager->monitor, 128 * 1024 * 1024);
+        /* 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_uevent < 0)
+                (void) sd_device_monitor_set_receive_buffer_size(manager->monitor, 128 * 1024 * 1024);
 
         r = device_monitor_enable_receiving(manager->monitor);
         if (r < 0)