From: Christian Brauner Date: Wed, 31 May 2017 16:02:08 +0000 (+0200) Subject: confile: add clearer for lxc.network X-Git-Tag: lxc-2.1.0~110^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f44882714c752130d63d8ec8630bf859b24868ca;p=thirdparty%2Flxc.git confile: add clearer for lxc.network Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 2fce26d38..01edcdbad 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -171,6 +171,7 @@ static int clr_config_network_item(const char *, struct lxc_conf *); static int set_config_network(const char *, const char *, struct lxc_conf *); static int get_config_network(const char *, char *, int, struct lxc_conf *); +static int clr_config_network(const char *, struct lxc_conf *); static int set_config_cap_drop(const char *, const char *, struct lxc_conf *); static int get_config_cap_drop(const char *, char *, int, struct lxc_conf *); @@ -283,7 +284,7 @@ static struct lxc_config_t config[] = { { "lxc.network.ipv6.gateway", set_config_network_ipv6_gateway, get_config_network_item, clr_config_network_item, }, { "lxc.network.ipv6", set_config_network_ipv6, get_config_network_item, clr_config_network_item, }, { "lxc.network.", set_config_network_nic, get_config_network_item, clr_config_network_item, }, - { "lxc.network", set_config_network, get_config_network, NULL }, + { "lxc.network", set_config_network, get_config_network, clr_config_network, }, { "lxc.cap.drop", set_config_cap_drop, get_config_cap_drop, NULL }, { "lxc.cap.keep", set_config_cap_keep, get_config_cap_keep, NULL }, { "lxc.console.logfile", set_config_console_logfile, get_config_console_logfile, NULL }, @@ -2753,10 +2754,7 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key) { int ret = 0; - if (strcmp(key, "lxc.network") == 0) { - ret = lxc_clear_config_network(c); - - } else if (strcmp(key, "lxc.cap.drop") == 0) { + if (strcmp(key, "lxc.cap.drop") == 0) { ret = lxc_clear_config_caps(c); } else if (strcmp(key, "lxc.cap.keep") == 0) { @@ -4169,3 +4167,9 @@ static inline int clr_config_network_item(const char *key, struct lxc_conf *c) { return lxc_clear_nic(c, key + 12); } + +static inline int clr_config_network(const char *key, struct lxc_conf *c) +{ + return lxc_clear_config_network(c); +} +