]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile_utils: make update_hwaddr() static
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 4 Mar 2019 19:30:41 +0000 (20:30 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 4 Mar 2019 19:42:11 +0000 (20:42 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c
src/lxc/confile_utils.c
src/lxc/confile_utils.h

index 2c420cf8b5980470b15be2f8aefea41dd1ae22e6..a61add7544691c4821d9ca7edd350dce7c42764f 100644 (file)
@@ -2081,6 +2081,40 @@ static int set_config_console_size(const char *key, const char *value,
        return 0;
 }
 
+/*
+ * 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.
+ */
+static void update_hwaddr(const char *line)
+{
+       char *p;
+
+       line += lxc_char_left_gc(line, strlen(line));
+       if (line[0] == '#')
+               return;
+
+       if (!lxc_config_net_is_hwaddr(line))
+               return;
+
+       /* Let config_net_hwaddr raise the error. */
+       p = strchr(line, '=');
+       if (!p)
+               return;
+       p++;
+
+       while (isblank(*p))
+               p++;
+
+       if (!*p)
+               return;
+
+       rand_complete_hwaddr(p);
+}
+
 int append_unexp_config_line(const char *line, struct lxc_conf *conf)
 {
        size_t linelen;
index fd6c28a0b9fbe56bae79d4885a45193feb9ca9b4..72db49a080095a1c1e164bece172388f99a00204 100644 (file)
@@ -601,40 +601,6 @@ void rand_complete_hwaddr(char *hwaddr)
        }
 }
 
-/*
- * 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.
- */
-void update_hwaddr(const char *line)
-{
-       char *p;
-
-       line += lxc_char_left_gc(line, strlen(line));
-       if (line[0] == '#')
-               return;
-
-       if (!lxc_config_net_is_hwaddr(line))
-               return;
-
-       /* Let config_net_hwaddr raise the error. */
-       p = strchr(line, '=');
-       if (!p)
-               return;
-       p++;
-
-       while (isblank(*p))
-               p++;
-
-       if (!*p)
-               return;
-
-       rand_complete_hwaddr(p);
-}
-
 bool new_hwaddr(char *hwaddr)
 {
        int ret;
@@ -703,7 +669,6 @@ int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
 
        return fulllen;
 }
-
 int lxc_get_conf_size_t(struct lxc_conf *c, char *retv, int inlen, size_t v)
 {
        int len;
index 2c3948b8fbab07defddc26cabfdb49458b6ae4b0..b097edc0fb28cdda1de2fcacc70846e5729228e6 100644 (file)
@@ -67,7 +67,6 @@ extern int config_ip_prefix(struct in_addr *addr);
 extern int network_ifname(char *valuep, const char *value, size_t size);
 extern void rand_complete_hwaddr(char *hwaddr);
 extern bool lxc_config_net_is_hwaddr(const char *line);
-extern void update_hwaddr(const char *line);
 extern bool new_hwaddr(char *hwaddr);
 extern int lxc_get_conf_str(char *retv, int inlen, const char *value);
 extern int lxc_get_conf_bool(struct lxc_conf *c, char *retv, int inlen, bool v);