plugins: replace arping package with arp_notify

this replaces the arping package with the linux arp_notify feature.

Resolves: #588
Signed-off-by: Michael Zappa <Michael.Zappa@stateless.net>
This commit is contained in:
Michael Zappa
2021-12-24 21:20:05 -07:00
parent cc32993e9e
commit 5d073d690c
21 changed files with 42 additions and 715 deletions

View File

@ -36,9 +36,8 @@ var (
func makeVethPair(name, peer string, mtu int, mac string, hostNS ns.NetNS) (netlink.Link, error) {
veth := &netlink.Veth{
LinkAttrs: netlink.LinkAttrs{
Name: name,
Flags: net.FlagUp,
MTU: mtu,
Name: name,
MTU: mtu,
},
PeerName: peer,
PeerNamespace: netlink.NsFd(int(hostNS.Fd())),
@ -146,10 +145,6 @@ func SetupVethWithName(contVethName, hostVethName string, mtu int, contVethMac s
return net.Interface{}, net.Interface{}, err
}
if err = netlink.LinkSetUp(contVeth); err != nil {
return net.Interface{}, net.Interface{}, fmt.Errorf("failed to set %q up: %v", contVethName, err)
}
var hostVeth netlink.Link
err = hostNS.Do(func(_ ns.NetNS) error {
hostVeth, err = netlink.LinkByName(hostVethName)