diff options
author | pjd <pjd@FreeBSD.org> | 2011-02-01 07:58:43 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-02-01 07:58:43 +0000 |
commit | 7cbf58f4c00954a5e25cf90d36ecef170a0b7d77 (patch) | |
tree | 657eac954247454214d4deb0f98ab4c905d49993 /sbin | |
parent | ef074acccef70cbe68906926996f371d53d09605 (diff) | |
download | FreeBSD-src-7cbf58f4c00954a5e25cf90d36ecef170a0b7d77.zip FreeBSD-src-7cbf58f4c00954a5e25cf90d36ecef170a0b7d77.tar.gz |
Do not set socket send and receive buffer. It will be auto-tuned.
Confirmed by: rwatson
MFC after: 1 week
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/hastd/proto_tcp4.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sbin/hastd/proto_tcp4.c b/sbin/hastd/proto_tcp4.c index 261dc80..2932144 100644 --- a/sbin/hastd/proto_tcp4.c +++ b/sbin/hastd/proto_tcp4.c @@ -170,7 +170,7 @@ static int tcp4_common_setup(const char *addr, void **ctxp, int side) { struct tcp4_ctx *tctx; - int ret, val; + int ret, nodelay; tctx = malloc(sizeof(*tctx)); if (tctx == NULL) @@ -190,21 +190,11 @@ tcp4_common_setup(const char *addr, void **ctxp, int side) } /* Socket settings. */ - val = 1; - if (setsockopt(tctx->tc_fd, IPPROTO_TCP, TCP_NODELAY, &val, - sizeof(val)) == -1) { + nodelay = 1; + if (setsockopt(tctx->tc_fd, IPPROTO_TCP, TCP_NODELAY, &nodelay, + sizeof(nodelay)) == -1) { pjdlog_warning("Unable to set TCP_NOELAY on %s", addr); } - val = 131072; - if (setsockopt(tctx->tc_fd, SOL_SOCKET, SO_SNDBUF, &val, - sizeof(val)) == -1) { - pjdlog_warning("Unable to set send buffer size on %s", addr); - } - val = 131072; - if (setsockopt(tctx->tc_fd, SOL_SOCKET, SO_RCVBUF, &val, - sizeof(val)) == -1) { - pjdlog_warning("Unable to set receive buffer size on %s", addr); - } tctx->tc_side = side; tctx->tc_magic = TCP4_CTX_MAGIC; |