Signed-off-by: Madhu Venugopal <madhu@docker.com>
| ... | ... |
@@ -4,7 +4,6 @@ import ( |
| 4 | 4 |
"fmt" |
| 5 | 5 |
|
| 6 | 6 |
"github.com/docker/libnetwork/netlabel" |
| 7 |
- "github.com/docker/libnetwork/options" |
|
| 8 | 7 |
"github.com/docker/libnetwork/types" |
| 9 | 8 |
) |
| 10 | 9 |
|
| ... | ... |
@@ -92,25 +91,6 @@ func (sb *sandbox) clearDefaultGW() error {
|
| 92 | 92 |
return nil |
| 93 | 93 |
} |
| 94 | 94 |
|
| 95 |
-func (c *controller) createGWNetwork() (Network, error) {
|
|
| 96 |
- netOption := options.Generic{
|
|
| 97 |
- "BridgeName": libnGWNetwork, |
|
| 98 |
- "EnableICC": false, |
|
| 99 |
- "EnableIPMasquerade": true, |
|
| 100 |
- } |
|
| 101 |
- |
|
| 102 |
- n, err := c.NewNetwork("bridge", libnGWNetwork,
|
|
| 103 |
- NetworkOptionGeneric(options.Generic{
|
|
| 104 |
- netlabel.GenericData: netOption, |
|
| 105 |
- netlabel.EnableIPv6: false, |
|
| 106 |
- })) |
|
| 107 |
- |
|
| 108 |
- if err != nil {
|
|
| 109 |
- return nil, fmt.Errorf("error creating external connectivity network: %v", err)
|
|
| 110 |
- } |
|
| 111 |
- return n, err |
|
| 112 |
-} |
|
| 113 |
- |
|
| 114 | 95 |
func (sb *sandbox) needDefaultGW() bool {
|
| 115 | 96 |
var needGW bool |
| 116 | 97 |
|
| 117 | 98 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,7 @@ |
| 0 |
+package libnetwork |
|
| 1 |
+ |
|
| 2 |
+import "github.com/docker/libnetwork/types" |
|
| 3 |
+ |
|
| 4 |
+func (c *controller) createGWNetwork() (Network, error) {
|
|
| 5 |
+ return nil, types.NotImplementedErrorf("default gateway functionality is not implemented in freebsd")
|
|
| 6 |
+} |
| 0 | 7 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,29 @@ |
| 0 |
+package libnetwork |
|
| 1 |
+ |
|
| 2 |
+import ( |
|
| 3 |
+ "fmt" |
|
| 4 |
+ "strconv" |
|
| 5 |
+ |
|
| 6 |
+ "github.com/docker/libnetwork/drivers/bridge" |
|
| 7 |
+ "github.com/docker/libnetwork/netlabel" |
|
| 8 |
+ "github.com/docker/libnetwork/options" |
|
| 9 |
+) |
|
| 10 |
+ |
|
| 11 |
+func (c *controller) createGWNetwork() (Network, error) {
|
|
| 12 |
+ netOption := map[string]string{
|
|
| 13 |
+ bridge.BridgeName: libnGWNetwork, |
|
| 14 |
+ bridge.EnableICC: strconv.FormatBool(false), |
|
| 15 |
+ bridge.EnableIPMasquerade: strconv.FormatBool(true), |
|
| 16 |
+ } |
|
| 17 |
+ |
|
| 18 |
+ n, err := c.NewNetwork("bridge", libnGWNetwork,
|
|
| 19 |
+ NetworkOptionGeneric(options.Generic{
|
|
| 20 |
+ netlabel.GenericData: netOption, |
|
| 21 |
+ netlabel.EnableIPv6: false, |
|
| 22 |
+ })) |
|
| 23 |
+ |
|
| 24 |
+ if err != nil {
|
|
| 25 |
+ return nil, fmt.Errorf("error creating external connectivity network: %v", err)
|
|
| 26 |
+ } |
|
| 27 |
+ return n, err |
|
| 28 |
+} |