The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1707

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Christian Brauner <[email protected]>
From 7e0ce3e520e1cdfe40dfc7073e4c16b84b6994c5 Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Mon, 17 Jul 2017 13:21:15 +0200
Subject: [PATCH 1/4] confile: clear ipv{4,6} gateway

Signed-off-by: Christian Brauner <[email protected]>
---
 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 <[email protected]>
Date: Mon, 17 Jul 2017 13:30:41 +0200
Subject: [PATCH 2/4] confile: clear network flags

Signed-off-by: Christian Brauner <[email protected]>
---
 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 <[email protected]>
Date: Mon, 17 Jul 2017 13:33:03 +0200
Subject: [PATCH 3/4] confile: clear macvlan mode

Signed-off-by: Christian Brauner <[email protected]>
---
 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 <[email protected]>
Date: Mon, 17 Jul 2017 13:34:20 +0200
Subject: [PATCH 4/4] confile: clear vlan id

Signed-off-by: Christian Brauner <[email protected]>
---
 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;
 
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to