diff --git a/plugin/net/cni.go b/plugin/net/cni.go index 1d9e4407..92e96c59 100644 --- a/plugin/net/cni.go +++ b/plugin/net/cni.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "net" + "syscall" "github.com/appc/cni/pkg/ipam" "github.com/appc/cni/pkg/skel" @@ -150,6 +151,11 @@ func assignBridgeIP(bridgeName string, ipnet net.IPNet) error { return err } if err := netlink.AddrAdd(link, &netlink.Addr{IPNet: &ipnet}); err != nil { + // Treat as non-error if this address is already there + // - maybe another copy of this program just added it + if err == syscall.Errno(syscall.EEXIST) { + return nil + } return fmt.Errorf("failed to add IP address to %q: %v", bridgeName, err) } return nil