mirror of
https://github.com/rancher/plugins.git
synced 2025-07-08 12:45:19 +00:00
Fix a race condition in the bridge plugin.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
ccd683e1a3
commit
ad7c1d189b
@ -175,7 +175,7 @@ func ensureAddr(br netlink.Link, family int, ipn *net.IPNet, forceAddress bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
addr := &netlink.Addr{IPNet: ipn, Label: ""}
|
addr := &netlink.Addr{IPNet: ipn, Label: ""}
|
||||||
if err := netlink.AddrAdd(br, addr); err != nil {
|
if err := netlink.AddrAdd(br, addr); err != nil && err != syscall.EEXIST {
|
||||||
return fmt.Errorf("could not add IP address to %q: %v", br.Attrs().Name, err)
|
return fmt.Errorf("could not add IP address to %q: %v", br.Attrs().Name, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user