diff options
-rw-r--r-- | api/grpc_server.go | 2 | ||||
-rw-r--r-- | gobgp/cmd/policy.go | 2 | ||||
-rw-r--r-- | server/server_test.go | 2 | ||||
-rw-r--r-- | server/sockopt_darwin.go | 8 |
4 files changed, 9 insertions, 5 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index a97e5b65..135546b5 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -69,7 +69,7 @@ func (s *Server) Serve() error { serve := func(host string) { defer wg.Done() - lis, err := net.Listen("tcp", fmt.Sprintf(host)) + lis, err := net.Listen("tcp", host) if err != nil { log.WithFields(log.Fields{ "Topic": "grpc", diff --git a/gobgp/cmd/policy.go b/gobgp/cmd/policy.go index ab91c402..7c8a5669 100644 --- a/gobgp/cmd/policy.go +++ b/gobgp/cmd/policy.go @@ -65,7 +65,7 @@ func formatDefinedSet(head bool, typ string, indent int, list []table.DefinedSet if i == 0 { buff.WriteString(fmt.Sprintf(format, s.Name(), x)) } else { - buff.WriteString(fmt.Sprintf(sIndent)) + buff.WriteString(fmt.Sprint(sIndent)) buff.WriteString(fmt.Sprintf(format, "", x)) } } diff --git a/server/server_test.go b/server/server_test.go index 7f854e73..c75003ed 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -169,7 +169,7 @@ func TestMonitor(test *testing.T) { if len(rib.GetKnownPathList("", 0)) > 0 { break } - time.Sleep(1) + time.Sleep(100 * time.Millisecond) } // Test WatchUpdate with "current" flag. 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) } |