Commit [bf3004]  Maximize  Restore  History

sctp: enlarge SO_RCVBUF option value

When using setsockopt() with recent Linux kernels, it doesn't make sense to
use a value smaller than SOCK_MIN_RCVBUF/2 for SO_RCVBUF and expect getting
a SO_RCVBUF value by getsockopt() which is doubled. See the following code
in linux/net/core/sock.c:

if ((val * 2) < SOCK_MIN_RCVBUF)
sk->sk_rcvbuf = SOCK_MIN_RCVBUF;
else
sk->sk_rcvbuf = val * 2;
break;

SOCK_MIN_RCVBUF is defined as (2048 + sizeof(struct sk_buff)) which is 2240.

Signed-off-by: Simon Xu <xu.simon@oracle.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>

Simon Xu Simon Xu 2013-11-04

Wanlong Gao Wanlong Gao 2013-11-04

changed testcases/network/sctp/func_tests/test_1_to_1_sockopt.c
testcases/network/sctp/func_tests/test_1_to_1_sockopt.c Diff Switch to side-by-side view
Loading...

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks