pkg/ip: improve docstring for SetupVeth
This commit is contained in:
parent
71d96ea91c
commit
bb322572eb
@ -109,9 +109,10 @@ func ifaceFromNetlinkLink(l netlink.Link) net.Interface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetupVeth sets up a virtual ethernet link.
|
// SetupVeth sets up a pair of virtual ethernet devices.
|
||||||
// Should be in container netns, and will switch back to hostNS to set the host
|
// Call SetupVeth from inside the container netns. It will create both veth
|
||||||
// veth end up.
|
// 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) {
|
func SetupVeth(contVethName string, mtu int, hostNS ns.NetNS) (net.Interface, net.Interface, error) {
|
||||||
hostVethName, contVeth, err := makeVeth(contVethName, mtu)
|
hostVethName, contVeth, err := makeVeth(contVethName, mtu)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user