diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index a6552b2687..f2e1148e87 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -640,6 +640,7 @@ int fd_set_sndbuf(int fd, size_t n, bool increase) { /* SO_SNDBUF above may set to the kernel limit, instead of the requested size. * So, we need to check the actual buffer size here. */ + l = sizeof(value); r = getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &value, &l); if (r >= 0 && l == sizeof(value) && increase ? (size_t) value >= n*2 : (size_t) value == n*2) return 1; @@ -670,6 +671,7 @@ int fd_set_rcvbuf(int fd, size_t n, bool increase) { /* SO_RCVBUF above may set to the kernel limit, instead of the requested size. * So, we need to check the actual buffer size here. */ + l = sizeof(value); r = getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &value, &l); if (r >= 0 && l == sizeof(value) && increase ? (size_t) value >= n*2 : (size_t) value == n*2) return 1;