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:
parent
31980a53ae
commit
d4091ef151
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue