]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: config_ephemeral()
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 30 May 2017 03:01:30 +0000 (05:01 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 30 May 2017 16:43:07 +0000 (18:43 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index 1fe536397de95409c2697291a2ccdf4da455fef9..fe21ba3856092cda441acfc1f44eea89ad37cd71 100644 (file)
@@ -3385,7 +3385,6 @@ static bool new_hwaddr(char *hwaddr)
 {
        int ret;
 
-       /* COMMENT(brauner): Initialize random number generator. */
        (void)randseed(true);
 
        ret = snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x", rand() % 255,
@@ -3474,9 +3473,13 @@ bool network_new_hwaddrs(struct lxc_conf *conf)
 static int config_ephemeral(const char *key, const char *value,
                            struct lxc_conf *lxc_conf)
 {
-       if (config_value_empty(value))
+       /* Set config value to default. */
+       if (config_value_empty(value)) {
+               lxc_conf->ephemeral = 0;
                return 0;
+       }
 
+       /* Parse new config value. */
        if (lxc_safe_uint(value, &lxc_conf->ephemeral) < 0)
                return -1;