pkg/ip: improve docstring for SetupVeth
authorGabe Rosenhouse <grosenhouse@pivotal.io>
Mon, 13 Mar 2017 18:27:12 +0000 (11:27 -0700)
committerGabe Rosenhouse <grosenhouse@pivotal.io>
Mon, 13 Mar 2017 18:27:12 +0000 (11:27 -0700)
pkg/ip/link.go

index 52f6aae..ff0bdb2 100644 (file)
@@ -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 {