Skip to content

Commit

Permalink
Merge pull request #10 from denis-tingajkin/fix_os_specific_code
Browse files Browse the repository at this point in the history
Remove GOOS checks
  • Loading branch information
haiodo authored Sep 8, 2020
2 parents 0ea22d8 + ef981ad commit 46ec3f9
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"fmt"
"os"
"path"
"runtime"
"strconv"
"time"

Expand Down Expand Up @@ -190,18 +189,12 @@ func RunClient(ctx context.Context, rootConf *config.Config, nsmClient networkse
switch clientConf.Mechanism {
case kernel.MECHANISM:
outgoingMechanism.Parameters[common.InterfaceNameKey] = clientConf.Path[0]

logrus.Infof("%v", runtime.GOOS)
if runtime.GOOS != "darwin" && runtime.GOOS != "windows" {
// Check we are not macos or windows.
inode, err := fs.GetInode("/proc/self/ns/net")
if err != nil {
logrus.Errorf("could not retrieve a linux namespace %v", err)
return connections, err
}
outgoingMechanism.Parameters[kernel.NetNSInodeKey] = strconv.FormatUint(uint64(inode), 10)
inode, err := fs.GetInode("/proc/self/ns/net")
if err != nil {
logrus.Errorf("could not retrieve a linux namespace %v", err)
return connections, err
}

outgoingMechanism.Parameters[kernel.NetNSInodeKey] = strconv.FormatUint(uint64(inode), 10)
kernel.ToMechanism(outgoingMechanism).SetNetNSURL("unix:///proc/self/ns/net")

case memif.MECHANISM:
Expand Down

0 comments on commit 46ec3f9

Please sign in to comment.