mirror of
https://github.com/rancher/os.git
synced 2025-09-03 07:44:21 +00:00
migrate to upstream libcompose in one and a half go
This commit is contained in:
7
vendor/github.com/vishvananda/netlink/neigh_linux.go
generated
vendored
7
vendor/github.com/vishvananda/netlink/neigh_linux.go
generated
vendored
@@ -70,10 +70,10 @@ func NeighAdd(neigh *Neigh) error {
|
||||
return neighAdd(neigh, syscall.NLM_F_CREATE|syscall.NLM_F_EXCL)
|
||||
}
|
||||
|
||||
// NeighAdd will add or replace an IP to MAC mapping to the ARP table
|
||||
// NeighSet will add or replace an IP to MAC mapping to the ARP table
|
||||
// Equivalent to: `ip neigh replace....`
|
||||
func NeighSet(neigh *Neigh) error {
|
||||
return neighAdd(neigh, syscall.NLM_F_CREATE)
|
||||
return neighAdd(neigh, syscall.NLM_F_CREATE|syscall.NLM_F_REPLACE)
|
||||
}
|
||||
|
||||
// NeighAppend will append an entry to FDB
|
||||
@@ -133,6 +133,7 @@ func NeighList(linkIndex, family int) ([]Neigh, error) {
|
||||
req := nl.NewNetlinkRequest(syscall.RTM_GETNEIGH, syscall.NLM_F_DUMP)
|
||||
msg := Ndmsg{
|
||||
Family: uint8(family),
|
||||
Index: uint32(linkIndex),
|
||||
}
|
||||
req.AddData(&msg)
|
||||
|
||||
@@ -141,7 +142,7 @@ func NeighList(linkIndex, family int) ([]Neigh, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
res := make([]Neigh, 0)
|
||||
var res []Neigh
|
||||
for _, m := range msgs {
|
||||
ndm := deserializeNdmsg(m)
|
||||
if linkIndex != 0 && int(ndm.Index) != linkIndex {
|
||||
|
Reference in New Issue
Block a user