aboutgitcodebugslistschat
path: root/tap.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-05 19:27:04 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-05 20:02:03 +0200
commitd4d61480b6883d462a2c3c99eaf315259e78c984 (patch)
tree099527a3fb68fcabe3953c55d67de9484ce9309b /tap.c
parenteef4e82903311c73a5da3030da7eee790ce783a5 (diff)
downloadpasst-d4d61480b6883d462a2c3c99eaf315259e78c984.tar
passt-d4d61480b6883d462a2c3c99eaf315259e78c984.tar.gz
passt-d4d61480b6883d462a2c3c99eaf315259e78c984.tar.bz2
passt-d4d61480b6883d462a2c3c99eaf315259e78c984.tar.lz
passt-d4d61480b6883d462a2c3c99eaf315259e78c984.tar.xz
passt-d4d61480b6883d462a2c3c99eaf315259e78c984.tar.zst
passt-d4d61480b6883d462a2c3c99eaf315259e78c984.zip
tcp, tap: Turn tcp_probe_mem() into sock_probe_mem(), use for AF_UNIX socket too
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tap.c')
-rw-r--r--tap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tap.c b/tap.c
index f395227..8d8f381 100644
--- a/tap.c
+++ b/tap.c
@@ -773,7 +773,7 @@ static void tap_sock_init_unix(struct ctx *c)
struct sockaddr_un addr = {
.sun_family = AF_UNIX,
};
- int i, ret;
+ int i, ret, v = INT_MAX / 2;
if (c->fd_tap_listen)
close(c->fd_tap_listen);
@@ -833,6 +833,12 @@ static void tap_sock_init_unix(struct ctx *c)
addr.sun_path);
c->fd_tap = accept(fd, NULL, NULL);
+
+ if (!c->low_rmem)
+ setsockopt(c->fd_tap, SOL_SOCKET, SO_RCVBUF, &v, sizeof(v));
+
+ if (!c->low_wmem)
+ setsockopt(c->fd_tap, SOL_SOCKET, SO_SNDBUF, &v, sizeof(v));
}
static int tun_ns_fd = -1;