util: try to set with SO_{RCV,SND}BUFFORCE when requested size is larger than the...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Sep 2020 15:11:14 +0000 (00:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Sep 2020 21:39:05 +0000 (06:39 +0900)
commitb92f350789e33942be0cf85af22a580c1fd483d6
treea1b04e82ddaaeb109887a70dfd816eef4c60105b
parent1263c85ef32ea35969748cd4304cd1a51d19e8d1
util: try to set with SO_{RCV,SND}BUFFORCE when requested size is larger than the kernel limit

The commit 10ce2e0681ac16e7bb3619b7bb1a72a6f98a2f2c inverts the order of
SO_{RCV,SND}BUFFORCE and SO_{RCV,SND}BUF. However, setting buffer size with
SO_{RCV,SND}BUF does not fail even if the requested size is larger than
the kernel limit. Hence, SO_{RCV,SND}BUFFORCE will not use anymore and
the buffer size is always limited by the kernel limit even if we have
the priviledge to ignore the limit.

This makes the buffer size is checked after configuring it with
SO_{RCV,SND}BUF, and if it is still not sufficient, then try to set it
with FORCE command. With this commit, if we have enough priviledge, the
requested buffer size is correctly set.

Hopefully fixes #14417.
src/basic/socket-util.c