@@ -22,7 +22,6 @@ import (
2222 "github.com/opencontainers/runtime-tools/generate"
2323 "github.com/opencontainers/selinux/go-selinux/label"
2424 "github.com/sirupsen/logrus"
25- "go.podman.io/common/libnetwork/slirp4netns"
2625 "go.podman.io/common/libnetwork/types"
2726 "go.podman.io/common/pkg/cgroups"
2827 "go.podman.io/common/pkg/config"
@@ -559,7 +558,7 @@ func (c *Container) setCgroupsPath(g *generate.Generator) error {
559558 return nil
560559}
561560
562- // addSpecialDNS adds special dns servers for slirp4netns and pasta
561+ // addSpecialDNS adds special dns servers for pasta
563562func (c * Container ) addSpecialDNS (nameservers []string ) []string {
564563 switch {
565564 case c .config .NetMode .IsBridge ():
@@ -569,42 +568,10 @@ func (c *Container) addSpecialDNS(nameservers []string) []string {
569568 }
570569 case c .pastaResult != nil :
571570 nameservers = append (nameservers , c .pastaResult .DNSForwardIPs ... )
572- case c .config .NetMode .IsSlirp4netns ():
573- // slirp4netns has a built in DNS forwarder.
574- slirp4netnsDNS , err := slirp4netns .GetDNS (c .slirp4netnsSubnet )
575- if err != nil {
576- logrus .Warn ("Failed to determine Slirp4netns DNS: " , err .Error ())
577- } else {
578- nameservers = append (nameservers , slirp4netnsDNS .String ())
579- }
580571 }
581572 return nameservers
582573}
583574
584- func (c * Container ) isSlirp4netnsIPv6 () bool {
585- if c .config .NetMode .IsSlirp4netns () {
586- extraOptions := c .config .NetworkOptions [slirp4netns .BinaryName ]
587- options := make ([]string , 0 , len (c .runtime .config .Engine .NetworkCmdOptions .Get ())+ len (extraOptions ))
588- options = append (options , c .runtime .config .Engine .NetworkCmdOptions .Get ()... )
589- options = append (options , extraOptions ... )
590-
591- // loop backwards as the last argument wins and we can exit early
592- // This should be kept in sync with c/common/libnetwork/slirp4netns.
593- for i := len (options ) - 1 ; i >= 0 ; i -- {
594- switch options [i ] {
595- case "enable_ipv6=true" :
596- return true
597- case "enable_ipv6=false" :
598- return false
599- }
600- }
601- // default is true
602- return true
603- }
604-
605- return false
606- }
607-
608575// check for net=none
609576func (c * Container ) hasNetNone () bool {
610577 if ! c .config .CreateNetNS {
0 commit comments