ipvlan: wrong name was used during link creation
authorEugene Yakubovich <eugene.yakubovich@coreos.com>
Fri, 10 Jul 2015 21:02:32 +0000 (14:02 -0700)
committerEugene Yakubovich <eugene.yakubovich@coreos.com>
Fri, 10 Jul 2015 21:02:35 +0000 (14:02 -0700)
Instead of temp (random) name, the final name (e.g. eth0)
was used during link creation. This would collide on hosts
that already had the an interface with such a name.

plugins/main/ipvlan/ipvlan.go

index a040552..fe4fc79 100644 (file)
@@ -86,7 +86,7 @@ func createIpvlan(conf *NetConf, ifName string, netns *os.File) error {
        mv := &netlink.IPVlan{
                LinkAttrs: netlink.LinkAttrs{
                        MTU:         conf.MTU,
-                       Name:        ifName,
+                       Name:        tmpName,
                        ParentIndex: m.Attrs().Index,
                        Namespace:   netlink.NsFd(int(netns.Fd())),
                },