Update to lastest vendor/github.com/vishvananda/netlink

Signed-off-by: Michael Cambria <mcambria@redhat.com>
This commit is contained in:
Michael Cambria
2021-04-14 12:24:51 -04:00
parent a5b79632bd
commit d6bf1eac6c
38 changed files with 1125 additions and 151 deletions

View File

@ -21,6 +21,22 @@ type Handle struct {
lookupByDump bool
}
// SetSocketTimeout configures timeout for default netlink sockets
func SetSocketTimeout(to time.Duration) error {
if to < time.Microsecond {
return fmt.Errorf("invalid timeout, minimul value is %s", time.Microsecond)
}
nl.SocketTimeoutTv = unix.NsecToTimeval(to.Nanoseconds())
return nil
}
// GetSocketTimeout returns the timeout value used by default netlink sockets
func GetSocketTimeout() time.Duration {
nsec := unix.TimevalToNsec(nl.SocketTimeoutTv)
return time.Duration(nsec) * time.Nanosecond
}
// SupportsNetlinkFamily reports whether the passed netlink family is supported by this Handle
func (h *Handle) SupportsNetlinkFamily(nlFamily int) bool {
_, ok := h.sockets[nlFamily]