summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorMikio Hara <mikioh.mikioh@gmail.com>2014-09-09 07:22:11 +0900
committerMikio Hara <mikioh.mikioh@gmail.com>2014-09-09 07:22:11 +0900
commit493c50a00a9d7123cff0f7c93dc7c8214cb35246 (patch)
tree86d4cecfbb6b5781511b2c4b87db4b20d8d04bdd /src/net
parent3a3b1f18fbb120402dada05c6ae81752ed34ba83 (diff)
downloadgo-493c50a00a9d7123cff0f7c93dc7c8214cb35246.tar.gz
net: don't set wrong option for controlling tcp keepalive on openbsd
Fixes issue 8679. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/141730043
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tcpsockopt_openbsd.go17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/net/tcpsockopt_openbsd.go b/src/net/tcpsockopt_openbsd.go
index 3480f932c..164434311 100644
--- a/src/net/tcpsockopt_openbsd.go
+++ b/src/net/tcpsockopt_openbsd.go
@@ -2,26 +2,15 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// TCP socket options for openbsd
-
package net
import (
- "os"
"syscall"
"time"
)
-// Set keep alive period.
func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
- if err := fd.incref(); err != nil {
- return err
- }
- defer fd.decref()
-
- // The kernel expects seconds so round to next highest second.
- d += (time.Second - time.Nanosecond)
- secs := int(d.Seconds())
-
- return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.SO_KEEPALIVE, secs))
+ // OpenBSD has no user-settable per-socket TCP keepalive
+ // options.
+ return syscall.EPROTONOSUPPORT
}