libnetwork/slirp4netns: split out const

The cross tests needs at least one empty file in the package in order to
work and we need to linux build tag om slirp4netns as it depends on linux
only code.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2023-06-21 13:48:37 +02:00
parent e834ca3816
commit d7c76067fd
2 changed files with 15 additions and 11 deletions

View File

@ -0,0 +1,12 @@
package slirp4netns
const (
ipv6ConfDefaultAcceptDadSysctl = "/proc/sys/net/ipv6/conf/default/accept_dad"
BinaryName = "slirp4netns"
// defaultMTU the default MTU override
defaultMTU = 65520
// default slirp4ns subnet
defaultSubnet = "10.0.2.0/24"
)

View File

@ -1,3 +1,6 @@
//go:build linux
// +build linux
package slirp4netns
import (
@ -92,17 +95,6 @@ func (w *logrusDebugWriter) Write(p []byte) (int, error) {
return len(p), nil
}
const (
ipv6ConfDefaultAcceptDadSysctl = "/proc/sys/net/ipv6/conf/default/accept_dad"
BinaryName = "slirp4netns"
// defaultMTU the default MTU override
defaultMTU = 65520
// default slirp4ns subnet
defaultSubnet = "10.0.2.0/24"
)
func checkSlirpFlags(path string) (*slirpFeatures, error) {
cmd := exec.Command(path, "--help")
out, err := cmd.CombinedOutput()