Using netns to perform socat

This commit removes the usage of nsenter and uses netns
to perform socat operation.

Signed-off-by: abhi <abhi@docker.com>
This commit is contained in:
abhi
2018-03-22 10:54:47 -07:00
parent c0f483adcf
commit aeef99a76e
2 changed files with 42 additions and 54 deletions

View File

@@ -117,3 +117,10 @@ func (n *NetNS) GetPath() string {
defer n.Unlock()
return n.ns.Path()
}
// GetNs returns the network namespace handle
func (n *NetNS) GetNs() cnins.NetNS {
n.Lock()
defer n.Unlock()
return n.ns
}