Merge pull request #687 from MikeZappa87/issue/588/removegArp

Replace arping package with arp_notify
This commit is contained in:
Casey Callendrello
2022-01-19 18:14:55 +01:00
committed by GitHub
21 changed files with 39 additions and 715 deletions

View File

@ -22,7 +22,6 @@ import (
"os"
"runtime"
"github.com/j-keck/arping"
"github.com/vishvananda/netlink"
"github.com/containernetworking/cni/pkg/skel"
@ -83,15 +82,15 @@ func setupContainerVeth(netns ns.NetNS, ifName string, mtu int, pr *current.Resu
pr.Interfaces = []*current.Interface{hostInterface, containerInterface}
if err = ipam.ConfigureIface(ifName, pr); err != nil {
return err
}
contVeth, err := net.InterfaceByName(ifName)
if err != nil {
return fmt.Errorf("failed to look up %q: %v", ifName, err)
}
if err = ipam.ConfigureIface(ifName, pr); err != nil {
return err
}
for _, ipc := range pr.IPs {
// Delete the route that was automatically added
route := netlink.Route{
@ -139,13 +138,6 @@ func setupContainerVeth(netns ns.NetNS, ifName string, mtu int, pr *current.Resu
}
}
// Send a gratuitous arp for all v4 addresses
for _, ipc := range pr.IPs {
if ipc.Address.IP.To4() != nil {
_ = arping.GratuitousArpOverIface(ipc.Address.IP, *contVeth)
}
}
return nil
})
if err != nil {