Send out arp update from CNI plugin
This commit is contained in:
1 parent
424d331a32
commit
ede00047db
3 files changed
+6
No files matched your search
@@ -70,3 +70,6 @@
|
|||||||
[submodule "vendor/github.com/coreos/go-iptables"]
|
[submodule "vendor/github.com/coreos/go-iptables"]
|
||||||
path = vendor/github.com/coreos/go-iptables
|
path = vendor/github.com/coreos/go-iptables
|
||||||
url = https://github.com/coreos/go-iptables
|
url = https://github.com/coreos/go-iptables
|
||||||
|
[submodule "vendor/github.com/j-keck/arping"]
|
||||||
|
path = vendor/github.com/j-keck/arping
|
||||||
|
url = https://github.com/j-keck/arping
|
||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/appc/cni/pkg/ipam"
|
"github.com/appc/cni/pkg/ipam"
|
||||||
"github.com/appc/cni/pkg/skel"
|
"github.com/appc/cni/pkg/skel"
|
||||||
"github.com/appc/cni/pkg/types"
|
"github.com/appc/cni/pkg/types"
|
||||||
|
"github.com/j-keck/arping"
|
||||||
"github.com/vishvananda/netlink"
|
"github.com/vishvananda/netlink"
|
||||||
"github.com/vishvananda/netns"
|
"github.com/vishvananda/netns"
|
||||||
weaveapi "github.com/weaveworks/weave/api"
|
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 {
|
if err = netlink.AddrAdd(guest, &netlink.Addr{IPNet: &ipnet}); err != nil {
|
||||||
return fmt.Errorf("failed to add IP address to %q: %v", name, err)
|
return fmt.Errorf("failed to add IP address to %q: %v", name, err)
|
||||||
}
|
}
|
||||||
|
arping.GratuitousArpOverIfaceByName(ipnet.IP, name)
|
||||||
for _, r := range routes {
|
for _, r := range routes {
|
||||||
if r.GW != nil {
|
if r.GW != nil {
|
||||||
err = addRoute(guest, netlink.SCOPE_UNIVERSE, &r.Dst, r.GW)
|
err = addRoute(guest, netlink.SCOPE_UNIVERSE, &r.Dst, r.GW)
|
||||||
|
|||||||
+1
Submodule vendor/github.com/j-keck/arping added at af9a9003cf.
Reference in new issue
Block a user