summaryrefslogtreecommitdiffstats
path: root/src/udev/udevd.c
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2020-01-28 16:22:12 +0100
committerLennart Poettering <lennart@poettering.net>2020-01-28 22:35:08 +0100
commit1ffadeaae32d3780b2a208cb7368661973e9c984 (patch)
treea7b552b9cd2421b43eab2b050aa7102a4cbddcc9 /src/udev/udevd.c
parenttest-network: fix test_qdisc2() (diff)
downloadsystemd-1ffadeaae32d3780b2a208cb7368661973e9c984.tar.xz
systemd-1ffadeaae32d3780b2a208cb7368661973e9c984.zip
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.
Diffstat (limited to '')
-rw-r--r--src/udev/udevd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 7678331897..ca65474f27 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)