update cadvisor, docker, and runc godeps
This commit is contained in:
11
vendor/github.com/vishvananda/netlink/addr_linux.go
generated
vendored
11
vendor/github.com/vishvananda/netlink/addr_linux.go
generated
vendored
@@ -65,7 +65,7 @@ func (h *Handle) addrHandle(link Link, addr *Addr, req *nl.NetlinkRequest) error
|
||||
msg := nl.NewIfAddrmsg(family)
|
||||
msg.Index = uint32(base.Index)
|
||||
msg.Scope = uint8(addr.Scope)
|
||||
prefixlen, _ := addr.Mask.Size()
|
||||
prefixlen, masklen := addr.Mask.Size()
|
||||
msg.Prefixlen = uint8(prefixlen)
|
||||
req.AddData(msg)
|
||||
|
||||
@@ -103,9 +103,14 @@ func (h *Handle) addrHandle(link Link, addr *Addr, req *nl.NetlinkRequest) error
|
||||
}
|
||||
}
|
||||
|
||||
if addr.Broadcast != nil {
|
||||
req.AddData(nl.NewRtAttr(syscall.IFA_BROADCAST, addr.Broadcast))
|
||||
if addr.Broadcast == nil {
|
||||
calcBroadcast := make(net.IP, masklen/8)
|
||||
for i := range localAddrData {
|
||||
calcBroadcast[i] = localAddrData[i] | ^addr.Mask[i]
|
||||
}
|
||||
addr.Broadcast = calcBroadcast
|
||||
}
|
||||
req.AddData(nl.NewRtAttr(syscall.IFA_BROADCAST, addr.Broadcast))
|
||||
|
||||
if addr.Label != "" {
|
||||
labelData := nl.NewRtAttr(syscall.IFA_LABEL, nl.ZeroTerminated(addr.Label))
|
||||
|
68
vendor/github.com/vishvananda/netlink/link_linux.go
generated
vendored
68
vendor/github.com/vishvananda/netlink/link_linux.go
generated
vendored
@@ -379,6 +379,74 @@ func (h *Handle) LinkSetVfTxRate(link Link, vf, rate int) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// LinkSetVfSpoofchk enables/disables spoof check on a vf for the link.
|
||||
// Equivalent to: `ip link set $link vf $vf spoofchk $check`
|
||||
func LinkSetVfSpoofchk(link Link, vf int, check bool) error {
|
||||
return pkgHandle.LinkSetVfSpoofchk(link, vf, check)
|
||||
}
|
||||
|
||||
// LinkSetVfSpookfchk enables/disables spoof check on a vf for the link.
|
||||
// Equivalent to: `ip link set $link vf $vf spoofchk $check`
|
||||
func (h *Handle) LinkSetVfSpoofchk(link Link, vf int, check bool) error {
|
||||
var setting uint32
|
||||
base := link.Attrs()
|
||||
h.ensureIndex(base)
|
||||
req := h.newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)
|
||||
|
||||
msg := nl.NewIfInfomsg(syscall.AF_UNSPEC)
|
||||
msg.Index = int32(base.Index)
|
||||
req.AddData(msg)
|
||||
|
||||
data := nl.NewRtAttr(nl.IFLA_VFINFO_LIST, nil)
|
||||
info := nl.NewRtAttrChild(data, nl.IFLA_VF_INFO, nil)
|
||||
if check {
|
||||
setting = 1
|
||||
}
|
||||
vfmsg := nl.VfSpoofchk{
|
||||
Vf: uint32(vf),
|
||||
Setting: setting,
|
||||
}
|
||||
nl.NewRtAttrChild(info, nl.IFLA_VF_SPOOFCHK, vfmsg.Serialize())
|
||||
req.AddData(data)
|
||||
|
||||
_, err := req.Execute(syscall.NETLINK_ROUTE, 0)
|
||||
return err
|
||||
}
|
||||
|
||||
// LinkSetVfTrust enables/disables trust state on a vf for the link.
|
||||
// Equivalent to: `ip link set $link vf $vf trust $state`
|
||||
func LinkSetVfTrust(link Link, vf int, state bool) error {
|
||||
return pkgHandle.LinkSetVfTrust(link, vf, state)
|
||||
}
|
||||
|
||||
// LinkSetVfTrust enables/disables trust state on a vf for the link.
|
||||
// Equivalent to: `ip link set $link vf $vf trust $state`
|
||||
func (h *Handle) LinkSetVfTrust(link Link, vf int, state bool) error {
|
||||
var setting uint32
|
||||
base := link.Attrs()
|
||||
h.ensureIndex(base)
|
||||
req := h.newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)
|
||||
|
||||
msg := nl.NewIfInfomsg(syscall.AF_UNSPEC)
|
||||
msg.Index = int32(base.Index)
|
||||
req.AddData(msg)
|
||||
|
||||
data := nl.NewRtAttr(nl.IFLA_VFINFO_LIST, nil)
|
||||
info := nl.NewRtAttrChild(data, nl.IFLA_VF_INFO, nil)
|
||||
if state {
|
||||
setting = 1
|
||||
}
|
||||
vfmsg := nl.VfTrust{
|
||||
Vf: uint32(vf),
|
||||
Setting: setting,
|
||||
}
|
||||
nl.NewRtAttrChild(info, nl.IFLA_VF_TRUST, vfmsg.Serialize())
|
||||
req.AddData(data)
|
||||
|
||||
_, err := req.Execute(syscall.NETLINK_ROUTE, 0)
|
||||
return err
|
||||
}
|
||||
|
||||
// LinkSetMaster sets the master of the link device.
|
||||
// Equivalent to: `ip link set $link master $master`
|
||||
func LinkSetMaster(link Link, master *Bridge) error {
|
||||
|
26
vendor/github.com/vishvananda/netlink/nl/link_linux.go
generated
vendored
26
vendor/github.com/vishvananda/netlink/nl/link_linux.go
generated
vendored
@@ -231,7 +231,8 @@ const (
|
||||
* on/off switch
|
||||
*/
|
||||
IFLA_VF_STATS /* network device statistics */
|
||||
IFLA_VF_MAX = IFLA_VF_STATS
|
||||
IFLA_VF_TRUST /* Trust state of VF */
|
||||
IFLA_VF_MAX = IFLA_VF_TRUST
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -259,6 +260,7 @@ const (
|
||||
SizeofVfSpoofchk = 0x08
|
||||
SizeofVfLinkState = 0x08
|
||||
SizeofVfRssQueryEn = 0x08
|
||||
SizeofVfTrust = 0x08
|
||||
)
|
||||
|
||||
// struct ifla_vf_mac {
|
||||
@@ -419,6 +421,28 @@ func (msg *VfRssQueryEn) Serialize() []byte {
|
||||
return (*(*[SizeofVfRssQueryEn]byte)(unsafe.Pointer(msg)))[:]
|
||||
}
|
||||
|
||||
// struct ifla_vf_trust {
|
||||
// __u32 vf;
|
||||
// __u32 setting;
|
||||
// };
|
||||
|
||||
type VfTrust struct {
|
||||
Vf uint32
|
||||
Setting uint32
|
||||
}
|
||||
|
||||
func (msg *VfTrust) Len() int {
|
||||
return SizeofVfTrust
|
||||
}
|
||||
|
||||
func DeserializeVfTrust(b []byte) *VfTrust {
|
||||
return (*VfTrust)(unsafe.Pointer(&b[0:SizeofVfTrust][0]))
|
||||
}
|
||||
|
||||
func (msg *VfTrust) Serialize() []byte {
|
||||
return (*(*[SizeofVfTrust]byte)(unsafe.Pointer(msg)))[:]
|
||||
}
|
||||
|
||||
const (
|
||||
IFLA_XDP_UNSPEC = iota
|
||||
IFLA_XDP_FD /* fd of xdp program to attach, or -1 to remove */
|
||||
|
Reference in New Issue
Block a user