summaryrefslogtreecommitdiff
path: root/libpod/network/create.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/network/create.go')
-rw-r--r--libpod/network/create.go26
1 files changed, 19 insertions, 7 deletions
diff --git a/libpod/network/create.go b/libpod/network/create.go
index e9ab93262..094fbe349 100644
--- a/libpod/network/create.go
+++ b/libpod/network/create.go
@@ -173,14 +173,26 @@ func createBridge(name string, options entities.NetworkCreateOptions, runtimeCon
ipMasq = false
}
- mtu, err := parseMTU(options.Options["mtu"])
- if err != nil {
- return "", err
- }
+ var mtu int
+ var vlan int
+ for k, v := range options.Options {
+ var err error
+ switch k {
+ case "mtu":
+ mtu, err = parseMTU(v)
+ if err != nil {
+ return "", err
+ }
- vlan, err := parseVlan(options.Options["vlan"])
- if err != nil {
- return "", err
+ case "vlan":
+ vlan, err = parseVlan(v)
+ if err != nil {
+ return "", err
+ }
+
+ default:
+ return "", errors.Errorf("unsupported option %s", k)
+ }
}
// obtain host bridge name