https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206716
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #4 from [email protected] --- Maybe I miss something, but looks like there is no bug in FreeBSD. Yes, on FreeBSD getsockopt(..., SO_SNDBUF, ...) returns "high watermark", but setsockopt(..., SO_SNDBUF, ...) attempts to resize the buffer and, on success, sets "high watermark" to the new buffer size. So getsockopt() returns the value set by getsockopt(). I have written a simple test and run it on the 10.1-RELEASE and 10.2-RELEASE: -----8<----- #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <err.h> #include <stdio.h> int main () { int s, size; socklen_t sizelen; s = socket(AF_INET6, SOCK_RAW, IPPROTO_IP); sizelen = sizeof size; getsockopt(s, SOL_SOCKET, SO_SNDBUF, &size, &sizelen); printf("Current socket send buffer size: %i\n", size); size /= 2; setsockopt(s, SOL_SOCKET, SO_SNDBUF, &size, sizelen); getsockopt(s, SOL_SOCKET, SO_SNDBUF, &size, &sizelen); printf("New socket send buffer size: %i\n", size); } -----8<----- $ cc test.so_sndbuf.c $ sudo ./a.out Current socket send buffer size: 9216 New socket send buffer size: 4608 -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-amd64 To unsubscribe, send any mail to "[email protected]"
