Skip to content

Commit

Permalink
confile: add clearer for lxc.network
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner authored and stgraber committed Jul 16, 2017
1 parent 595f5f4 commit e512a89
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/lxc/confile.c
Expand Up @@ -162,6 +162,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 *);
Expand Down Expand Up @@ -265,7 +266,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 },
Expand Down Expand Up @@ -2549,10 +2550,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) {
Expand Down Expand Up @@ -3823,3 +3821,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);
}

0 comments on commit e512a89

Please sign in to comment.