From f51dd618c5eab4f4b3bb8489242941fdeec17057 Mon Sep 17 00:00:00 2001 From: Gabe Rosenhouse Date: Mon, 13 Mar 2017 11:27:12 -0700 Subject: [PATCH] pkg/ip: improve docstring for SetupVeth --- pkg/ip/link.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/ip/link.go b/pkg/ip/link.go index 52f6aae2..ff0bdb29 100644 --- a/pkg/ip/link.go +++ b/pkg/ip/link.go @@ -109,9 +109,10 @@ func ifaceFromNetlinkLink(l netlink.Link) net.Interface { } } -// SetupVeth sets up a virtual ethernet link. -// Should be in container netns, and will switch back to hostNS to set the host -// veth end up. +// SetupVeth sets up a pair of virtual ethernet devices. +// Call SetupVeth from inside the container netns. It will create both veth +// devices and move the host-side veth into the provided hostNS namespace. +// On success, SetupVeth returns (hostVeth, containerVeth, nil) func SetupVeth(contVethName string, mtu int, hostNS ns.NetNS) (net.Interface, net.Interface, error) { hostVethName, contVeth, err := makeVeth(contVethName, mtu) if err != nil {