Date: Tue, 23 Jul 2002 01:34:55 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Cc: net@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet tcp_input.c Message-ID: <20020722223455.GA34550@sunbay.com> In-Reply-To: <200207222231.g6MMVA5Y009413@freefall.freebsd.org> References: <200207222231.g6MMVA5Y009413@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--wzJLGUyc3ArbnUjN Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 22, 2002 at 03:31:10PM -0700, Ruslan Ermilov wrote: > ru 2002/07/22 15:31:10 PDT >=20 > Modified files: > sys/netinet tcp_input.c=20 > Log: > Don't shrink socket buffers in tcp_mss(), application might have already > configured them with setsockopt(SO_*BUF), for RFC1323's scaled windows. > =20 > PR: kern/11966 > MFC after: 1 week > =20 > Revision Changes Path > 1.166 +4 -2 src/sys/netinet/tcp_input.c >=20 The attached program could be used as a regression test. Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tcp.c" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <err.h> #include <stdio.h> #include <unistd.h> int main(int argc __unused, char *argv[] __unused) { int s; struct sockaddr_in addr; char data[100]; int optval; socklen_t optlen; if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) err(1, "socket"); addr.sin_len = sizeof addr; addr.sin_family = AF_INET; addr.sin_port = htons(9); /* discard */ addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); if (getsockopt(s, SOL_SOCKET, SO_RCVBUF, &optval, &optlen) == -1) err(1, "getsockopt"); printf("default rcv. buffer size: %d bytes\n", optval); optval = 80000; if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &optval, optlen) == -1) err(1, "setsockopt"); if (getsockopt(s, SOL_SOCKET, SO_RCVBUF, &optval, &optlen) == -1) err(1, "getsockopt"); printf("rcv. buffer size after setsockopt(): %d bytes\n", optval); if (connect(s, (struct sockaddr *)&addr, sizeof addr) == -1) err(1, "connect"); if (getsockopt(s, SOL_SOCKET, SO_RCVBUF, &optval, &optlen) == -1) err(1, "getsockopt"); printf("rcv. buffer size after connect(): %d bytes\n", optval); if (send(s, data, sizeof data, 0) == -1) err(1, "send"); if (getsockopt(s, SOL_SOCKET, SO_RCVBUF, &optval, &optlen) == -1) err(1, "getsockopt"); printf("rcv. buffer size after send(): %d bytes\n", optval); if (shutdown(s, SHUT_RDWR) == -1) err(1, "shutdown"); exit(0); } --6TrnltStXW4iwmi0-- --wzJLGUyc3ArbnUjN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9PIiPUkv4P6juNwoRApPnAJ9D4pWx6ecz9ccd/xnduVgS7XrqaQCfUkcL yGHkVUMdYOhvRCDJbf3e9Is= =8aBI -----END PGP SIGNATURE----- --wzJLGUyc3ArbnUjN-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020722223455.GA34550>