mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-06-15 18:15:48 +00:00
Made use of map[string]string for nw options in default-gateway impl
Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/libnetwork/netlabel"
|
||||
"github.com/docker/libnetwork/options"
|
||||
"github.com/docker/libnetwork/types"
|
||||
)
|
||||
|
||||
@@ -92,25 +91,6 @@ func (sb *sandbox) clearDefaultGW() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *controller) createGWNetwork() (Network, error) {
|
||||
netOption := options.Generic{
|
||||
"BridgeName": libnGWNetwork,
|
||||
"EnableICC": false,
|
||||
"EnableIPMasquerade": true,
|
||||
}
|
||||
|
||||
n, err := c.NewNetwork("bridge", libnGWNetwork,
|
||||
NetworkOptionGeneric(options.Generic{
|
||||
netlabel.GenericData: netOption,
|
||||
netlabel.EnableIPv6: false,
|
||||
}))
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating external connectivity network: %v", err)
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
func (sb *sandbox) needDefaultGW() bool {
|
||||
var needGW bool
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package libnetwork
|
||||
|
||||
import "github.com/docker/libnetwork/types"
|
||||
|
||||
func (c *controller) createGWNetwork() (Network, error) {
|
||||
return nil, types.NotImplementedErrorf("default gateway functionality is not implemented in freebsd")
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package libnetwork
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/docker/libnetwork/drivers/bridge"
|
||||
"github.com/docker/libnetwork/netlabel"
|
||||
"github.com/docker/libnetwork/options"
|
||||
)
|
||||
|
||||
func (c *controller) createGWNetwork() (Network, error) {
|
||||
netOption := map[string]string{
|
||||
bridge.BridgeName: libnGWNetwork,
|
||||
bridge.EnableICC: strconv.FormatBool(false),
|
||||
bridge.EnableIPMasquerade: strconv.FormatBool(true),
|
||||
}
|
||||
|
||||
n, err := c.NewNetwork("bridge", libnGWNetwork,
|
||||
NetworkOptionGeneric(options.Generic{
|
||||
netlabel.GenericData: netOption,
|
||||
netlabel.EnableIPv6: false,
|
||||
}))
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating external connectivity network: %v", err)
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package libnetwork
|
||||
|
||||
import "github.com/docker/libnetwork/types"
|
||||
|
||||
func (c *controller) createGWNetwork() (Network, error) {
|
||||
return nil, types.NotImplementedErrorf("default gateway functionality is not implemented in windows")
|
||||
}
|
||||
Reference in New Issue
Block a user