update vendor
This commit is contained in:
32
vendor/github.com/docker/libnetwork/ipvs/ipvs.go
generated
vendored
32
vendor/github.com/docker/libnetwork/ipvs/ipvs.go
generated
vendored
@@ -5,12 +5,19 @@ package ipvs
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"fmt"
|
||||
|
||||
"github.com/vishvananda/netlink/nl"
|
||||
"github.com/vishvananda/netns"
|
||||
)
|
||||
|
||||
const (
|
||||
netlinkRecvSocketsTimeout = 3 * time.Second
|
||||
netlinkSendSocketTimeout = 30 * time.Second
|
||||
)
|
||||
|
||||
// Service defines an IPVS service in its entirety.
|
||||
type Service struct {
|
||||
// Virtual service address.
|
||||
@@ -46,13 +53,15 @@ type SvcStats struct {
|
||||
// Destination defines an IPVS destination (real server) in its
|
||||
// entirety.
|
||||
type Destination struct {
|
||||
Address net.IP
|
||||
Port uint16
|
||||
Weight int
|
||||
ConnectionFlags uint32
|
||||
AddressFamily uint16
|
||||
UpperThreshold uint32
|
||||
LowerThreshold uint32
|
||||
Address net.IP
|
||||
Port uint16
|
||||
Weight int
|
||||
ConnectionFlags uint32
|
||||
AddressFamily uint16
|
||||
UpperThreshold uint32
|
||||
LowerThreshold uint32
|
||||
ActiveConnections int
|
||||
InactiveConnections int
|
||||
}
|
||||
|
||||
// Handle provides a namespace specific ipvs handle to program ipvs
|
||||
@@ -82,6 +91,15 @@ func New(path string) (*Handle, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Add operation timeout to avoid deadlocks
|
||||
tv := syscall.NsecToTimeval(netlinkSendSocketTimeout.Nanoseconds())
|
||||
if err := sock.SetSendTimeout(&tv); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tv = syscall.NsecToTimeval(netlinkRecvSocketsTimeout.Nanoseconds())
|
||||
if err := sock.SetReceiveTimeout(&tv); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Handle{sock: sock}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user