From: Franck Bui Date: Tue, 28 Jan 2020 15:22:12 +0000 (+0100) Subject: udev: assume that the recv buffer size of the netlink socket is already configured... X-Git-Tag: v245-rc1~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ffadeaae32d3780b2a208cb7368661973e9c984;p=thirdparty%2Fsystemd.git udev: assume that the recv buffer size of the netlink socket is already configured when the socket is passed in This makes ReceiveBuffer= option in systemd-udevd-kernel.socket unit useful. --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 7678331897f..ca65474f276 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -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)