Send out arp update from CNI plugin

This commit is contained in:
Bryan Boreham committed 2016-05-25 12:05:20 +01:00
1 parent 424d331a32
commit ede00047db
3 files changed
+6

No files matched your search

+2
View File
@@ -10,6 +10,7 @@ import (
"github.com/appc/cni/pkg/ipam"
"github.com/appc/cni/pkg/skel"
"github.com/appc/cni/pkg/types"
"github.com/j-keck/arping"
"github.com/vishvananda/netlink"
"github.com/vishvananda/netns"
weaveapi "github.com/weaveworks/weave/api"
@@ -151,6 +152,7 @@ func setupGuestIP4(origName, name string, ipnet net.IPNet, gw net.IP, routes []t
if err = netlink.AddrAdd(guest, &netlink.Addr{IPNet: &ipnet}); err != nil {
return fmt.Errorf("failed to add IP address to %q: %v", name, err)
}
arping.GratuitousArpOverIfaceByName(ipnet.IP, name)
for _, r := range routes {
if r.GW != nil {
err = addRoute(guest, netlink.SCOPE_UNIVERSE, &r.Dst, r.GW)