pkg/ip: Ensure that SetupVeth returns correct hostVeth

The veth is moved from the container NS to the host NS.
This is handled by the code that sets the link to UP but the wrong
hostVeth is returned to the calling code.
This commit is contained in:
Tom Denham
2016-08-29 14:10:36 -07:00
parent 415d707faf
commit 31ef82276a
2 changed files with 8 additions and 4 deletions

View File

@ -117,7 +117,7 @@ func SetupVeth(contVethName string, mtu int, hostNS ns.NetNS) (hostVeth, contVet
}
err = hostNS.Do(func(_ ns.NetNS) error {
hostVeth, err := netlink.LinkByName(hostVethName)
hostVeth, err = netlink.LinkByName(hostVethName)
if err != nil {
return fmt.Errorf("failed to lookup %q in %q: %v", hostVethName, hostNS.Path(), err)
}