[Bug 204438] setsockopt() handling of kern.ipc.maxsockbuf limit

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Nov 12 19:54:39 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204438

--- Comment #16 from Cameron Sparr <cameronsparr at gmail.com> ---
I forgot that it's actually spelled out pretty clearly in the comments of the
code:

/* Don't error on this BSD doesn't and if you think
 * about it this is right. Otherwise apps have to
 * play 'guess the biggest size' games. RCVBUF/SNDBUF
 * are treated in BSD as hints
 */
val = min_t(u32, val, sysctl_rmem_max);

So essentially they are just treating those buffer sizes as "hints". It makes
some sense, because they are correct about applications having no idea what
size they can actually set it to (without root access to the system).

So that would be another option, which is to just set the buffer to min(cc,
sb_max_adj)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-net mailing list