diff options
author | Jeff Bean <jeffreyrobertbean@gmail.com> | 2018-06-14 08:24:14 -0700 |
---|---|---|
committer | Jeff Bean <jeffreyrobertbean@gmail.com> | 2018-06-14 08:25:20 -0700 |
commit | b73933c4b20e15f468944edd7012a7cc90adf0e7 (patch) | |
tree | 12eea924430fce2ac2c0921fdf013ccec02d662e /server/sockopt_darwin.go | |
parent | 0d64c69d136d6a49a11c820604ba1dde0cd60799 (diff) |
simple staticcheck issues
Diffstat (limited to 'server/sockopt_darwin.go')
-rw-r--r-- | server/sockopt_darwin.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/sockopt_darwin.go b/server/sockopt_darwin.go index 47cebe44..4bad54ff 100644 --- a/server/sockopt_darwin.go +++ b/server/sockopt_darwin.go @@ -39,19 +39,23 @@ func setsockoptIpTtl(fd int, family int, value int) error { func setListenTcpTTLSockopt(l *net.TCPListener, ttl int) error { fi, family, err := extractFileAndFamilyFromTCPListener(l) - defer fi.Close() if err != nil { return err } + + defer fi.Close() + return setsockoptIpTtl(int(fi.Fd()), family, ttl) } func setTcpTTLSockopt(conn *net.TCPConn, ttl int) error { fi, family, err := extractFileAndFamilyFromTCPConn(conn) - defer fi.Close() if err != nil { return err } + + defer fi.Close() + return setsockoptIpTtl(int(fi.Fd()), family, ttl) } |