From e5353649f64b48268fadbc5805b9454cf51d8957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Mat=C4=9Bja?= Date: Thu, 27 Jun 2019 15:53:57 +0200 Subject: [PATCH 1/2] Macvlan network handles netlabel.Internal wrong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check value of netlabel.Internal not just it's existence Signed-off-by: Pavel Matěja --- libnetwork/drivers/macvlan/macvlan_network.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libnetwork/drivers/macvlan/macvlan_network.go b/libnetwork/drivers/macvlan/macvlan_network.go index beeed41638..8c515bb2f4 100644 --- a/libnetwork/drivers/macvlan/macvlan_network.go +++ b/libnetwork/drivers/macvlan/macvlan_network.go @@ -186,10 +186,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 From 12a182e937c9dde5413c1b1dcae208ddfa9cb48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Mat=C4=9Bja?= Date: Mon, 15 Jul 2019 10:15:53 +0200 Subject: [PATCH 2/2] Ipvlan network handles netlabel.Internal wrong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check value of netlabel.Internal not just it's existence Signed-off-by: Pavel Matěja --- libnetwork/drivers/ipvlan/ipvlan_network.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libnetwork/drivers/ipvlan/ipvlan_network.go b/libnetwork/drivers/ipvlan/ipvlan_network.go index 8825e1e117..39980fb316 100644 --- a/libnetwork/drivers/ipvlan/ipvlan_network.go +++ b/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 }