]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile_utils: supporting new net hwaddr key in update_hwaddr
author0x0916 <w@laoqinren.net>
Wed, 28 Jun 2017 02:59:39 +0000 (10:59 +0800)
committer0x0916 <w@laoqinren.net>
Thu, 29 Jun 2017 05:18:41 +0000 (13:18 +0800)
Signed-off-by: 0x0916 <w@laoqinren.net>
src/lxc/confile_utils.c

index 3329a819a5cf362e7dfb446745c3249cea3e75ba..b632d7b59ad3a57ad24f13123e7d60ba7bcca4a9 100644 (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. */