Skip to content

Commit

Permalink
Document that New() changes the current ns
Browse files Browse the repository at this point in the history
  • Loading branch information
povik authored and vishvananda committed Jun 25, 2019
1 parent a1b8f1f commit 6ed29a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion netns_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ func Set(ns NsHandle) (err error) {
return Setns(ns, CLONE_NEWNET)
}

// New creates a new network namespace and returns a handle to it.
// New creates a new network namespace, sets it as current and returns
// a handle to it.
func New() (ns NsHandle, err error) {
if err := syscall.Unshare(CLONE_NEWNET); err != nil {
return -1, err
Expand Down

0 comments on commit 6ed29a6

Please sign in to comment.