Skip to content

Commit

Permalink
libnetwork/slirp4netns: build result type on all oses
Browse files Browse the repository at this point in the history
My plan is to directly use the result in podman on the Container struct,
this is shared with freebsd even though slirp4netns will never be used
there. Thus we can simply move the type definition to the file that is
shared to not cause build problems.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Mar 21, 2024
1 parent f12a245 commit 897f762
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 12 additions & 0 deletions libnetwork/slirp4netns/const.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package slirp4netns

import "net"

const (
ipv6ConfDefaultAcceptDadSysctl = "/proc/sys/net/ipv6/conf/default/accept_dad"
BinaryName = "slirp4netns"
Expand All @@ -10,3 +12,13 @@ const (
// default slirp4ns subnet
defaultSubnet = "10.0.2.0/24"
)

// SetupResult return type from Setup()
type SetupResult struct {
// Pid of the created slirp4netns process
Pid int
// Subnet which is used by slirp4netns
Subnet *net.IPNet
// IPv6 whenever Ipv6 is enabled in slirp4netns
IPv6 bool
}
10 changes: 0 additions & 10 deletions libnetwork/slirp4netns/slirp4netns.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,6 @@ type SetupOptions struct {
Pdeathsig syscall.Signal
}

// SetupResult return type from Setup()
type SetupResult struct {
// Pid of the created slirp4netns process
Pid int
// Subnet which is used by slirp4netns
Subnet *net.IPNet
// IPv6 whenever Ipv6 is enabled in slirp4netns
IPv6 bool
}

type logrusDebugWriter struct {
prefix string
}
Expand Down

0 comments on commit 897f762

Please sign in to comment.