[lxc-devel] [lxc/stable-2.0] stable-2.0: bugfixes

brauner on Github lxc-bot at linuxcontainers.org
Mon Jul 17 11:38:41 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170717/df85a1ff/attachment.bin>
-------------- next part --------------
From 7e0ce3e520e1cdfe40dfc7073e4c16b84b6994c5 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 17 Jul 2017 13:21:15 +0200
Subject: [PATCH 1/4] confile: clear ipv{4,6} gateway

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/confile.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index bee2eb65b..79cb04618 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -1100,6 +1100,11 @@ static int set_config_network_ipv4_gateway(const char *key, const char *value,
 
 	free(netdev->ipv4_gateway);
 
+	if (lxc_config_value_empty(value)) {
+		netdev->ipv4_gateway = NULL;
+		return 0;
+	}
+
 	if (!strcmp(value, "auto")) {
 		netdev->ipv4_gateway = NULL;
 		netdev->ipv4_gateway_auto = true;
@@ -1200,6 +1205,11 @@ static int set_config_network_ipv6_gateway(const char *key, const char *value,
 
 	free(netdev->ipv6_gateway);
 
+	if (lxc_config_value_empty(value)) {
+		netdev->ipv6_gateway = NULL;
+		return 0;
+	}
+
 	if (!strcmp(value, "auto")) {
 		netdev->ipv6_gateway = NULL;
 		netdev->ipv6_gateway_auto = true;

From 56a480377aac341f53b43a97e8b82eba7299d667 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 17 Jul 2017 13:30:41 +0200
Subject: [PATCH 2/4] confile: clear network flags

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/confile.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index 79cb04618..da26e617e 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -871,6 +871,11 @@ static int set_config_network_flags(const char *key, const char *value,
 	if (!netdev)
 		return -1;
 
+	if (lxc_config_value_empty(value)) {
+		netdev->flags = 0;
+		return 0;
+	}
+
 	netdev->flags |= IFF_UP;
 
 	return 0;

From ef88314ccafd5ff3986dc3ba59d9bf5a0836ace5 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 17 Jul 2017 13:33:03 +0200
Subject: [PATCH 3/4] confile: clear macvlan mode

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/confile.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index da26e617e..0597d8e3b 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -937,6 +937,11 @@ static int set_config_network_macvlan_mode(const char *key, const char *value,
 		return -1;
 	}
 
+	if (lxc_config_value_empty(value)) {
+		netdev->priv.macvlan_attr.mode = 0;
+		return 0;
+	}
+
 	return macvlan_mode(&netdev->priv.macvlan_attr.mode, value);
 }
 

From 4eb33ee55496043a4b973c23e86618dbcf6d80d9 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 17 Jul 2017 13:34:20 +0200
Subject: [PATCH 4/4] confile: clear vlan id

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/confile.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index 0597d8e3b..6a6f549c9 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -988,6 +988,11 @@ static int set_config_network_vlan_id(const char *key, const char *value,
 		return -1;
 	}
 
+	if (lxc_config_value_empty(value)) {
+		netdev->priv.vlan_attr.vid = 0;
+		return 0;
+	}
+
 	if (get_u16(&netdev->priv.vlan_attr.vid, value, 0))
 		return -1;
 


More information about the lxc-devel mailing list