Browse Source

Ipvlan network handles netlabel.Internal wrong

check value of netlabel.Internal not just it's existence

Signed-off-by: Pavel Matěja <pavel@verotel.cz>
Pavel Matěja 6 years ago
parent
commit
12a182e937
1 changed files with 6 additions and 4 deletions
  1. 6 4
      libnetwork/drivers/ipvlan/ipvlan_network.go

+ 6 - 4
libnetwork/drivers/ipvlan/ipvlan_network.go

@@ -182,10 +182,12 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err
 		}
 	}
 	// setting the parent to "" will trigger an isolated network dummy parent link
-	if _, ok := option[netlabel.Internal]; ok {
-		config.Internal = true
-		// empty --parent= and --internal are handled the same.
-		config.Parent = ""
+	if val, ok := option[netlabel.Internal]; ok {
+		if internal, ok := val.(bool); ok && internal {
+			config.Internal = true
+			// empty --parent= and --internal are handled the same.
+			config.Parent = ""
+		}
 	}
 	return config, nil
 }