fix minor issue

When failed to attach veth pair, should remove the veth device

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
This commit is contained in:
Wentao Zhang 2017-03-17 03:11:19 +08:00
parent 31980a53ae
commit d4091ef151
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ func (v *veth) create(n *network, nspid int) (err error) {
netlink.LinkDel(veth) netlink.LinkDel(veth)
} }
}() }()
if err := v.attach(&n.Network); err != nil { if err = v.attach(&n.Network); err != nil {
return err return err
} }
child, err := netlink.LinkByName(n.TempVethPeerName) child, err := netlink.LinkByName(n.TempVethPeerName)