Unverified Commit 61e3ec8f by Christian Brauner Committed by Stéphane Graber

confile: config_ephemeral()

parent 71162625
...@@ -3016,7 +3016,6 @@ static bool new_hwaddr(char *hwaddr) ...@@ -3016,7 +3016,6 @@ static bool new_hwaddr(char *hwaddr)
{ {
int ret; int ret;
/* COMMENT(brauner): Initialize random number generator. */
(void)randseed(true); (void)randseed(true);
ret = snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x", rand() % 255, ret = snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x", rand() % 255,
...@@ -3105,9 +3104,13 @@ bool network_new_hwaddrs(struct lxc_conf *conf) ...@@ -3105,9 +3104,13 @@ bool network_new_hwaddrs(struct lxc_conf *conf)
static int config_ephemeral(const char *key, const char *value, static int config_ephemeral(const char *key, const char *value,
struct lxc_conf *lxc_conf) 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; return 0;
}
/* Parse new config value. */
if (lxc_safe_uint(value, &lxc_conf->ephemeral) < 0) if (lxc_safe_uint(value, &lxc_conf->ephemeral) < 0)
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment