]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: supporting new net hwaddr key in network_new_hwaddrs
author0x0916 <w@laoqinren.net>
Wed, 28 Jun 2017 02:58:29 +0000 (10:58 +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.c

index ca50946b906a36890e0dfc187a3ada6f9cefdb93..a63b5e398b6f662cc63f5b4da30ed2123391be61 100644 (file)
@@ -2606,7 +2606,6 @@ bool network_new_hwaddrs(struct lxc_conf *conf)
 {
        char *lend, *p, *p2;
        struct lxc_list *it;
-       const char *key = "lxc.network.hwaddr";
        char *lstart = conf->unexpanded_config;
 
        if (!conf->unexpanded_config)
@@ -2621,12 +2620,12 @@ bool network_new_hwaddrs(struct lxc_conf *conf)
                else
                        lend++;
 
-               if (strncmp(lstart, key, strlen(key)) != 0) {
+               if (!lxc_config_net_hwaddr(lstart)) {
                        lstart = lend;
                        continue;
                }
 
-               p = strchr(lstart + strlen(key), '=');
+               p = strchr(lstart, '=');
                if (!p) {
                        lstart = lend;
                        continue;