confile_utils: supporting new net hwaddr key in update_hwaddr

Signed-off-by: 0x0916 <w@laoqinren.net>
This commit is contained in:
0x0916 2017-06-28 10:59:39 +08:00
parent 4a787c27b2
commit ae1dc8b42e

View File

@ -593,9 +593,9 @@ bool lxc_config_net_hwaddr(const char *line)
}
/*
* If we find a lxc.net.hwaddr in the original config file, we expand it in
* the unexpanded_config, so that after a save_config we store the hwaddr for
* re-use.
* If we find a lxc.net.[i].hwaddr or lxc.network.hwaddr in the original config
* file, we expand it in the unexpanded_config, so that after a save_config we
* store the hwaddr for re-use.
* This is only called when reading the config file, not when executing a
* lxc.include.
* 'x' and 'X' are substituted in-place.
@ -608,8 +608,7 @@ void update_hwaddr(const char *line)
if (line[0] == '#')
return;
if ((strncmp(line, "lxc.network.hwaddr", 18) != 0) &&
(strncmp(line, "lxc.net.hwaddr", 14) != 0))
if (!lxc_config_net_hwaddr(line))
return;
/* Let config_net_hwaddr raise the error. */