]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Multiple IP addresses: add them in the correct order
authorChristian Seiler <christian@iwakd.de>
Tue, 15 Jan 2013 13:44:25 +0000 (14:44 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 15 Jan 2013 16:36:33 +0000 (11:36 -0500)
Make sure that when configuring containers that have interfaces containing
multiple IP addresses they are added in the order of the configuration file
(i.e. the first being the primary one) and not the reverse order.

Signed-off-by: Christian Seiler <christian@iwakd.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/confile.c

index 034136ef52845c68687a2575174dd8c857d46bfb..da870887816b58497009980acb1b04a47c953b61 100644 (file)
@@ -624,7 +624,7 @@ static int config_network_ipv4(const char *key, const char *value,
                        htonl(INADDR_BROADCAST >>  inetdev->prefix);
        }
 
-       lxc_list_add(&netdev->ipv4, list);
+       lxc_list_add_tail(&netdev->ipv4, list);
 
        free(addr);
        return 0;
@@ -716,7 +716,7 @@ static int config_network_ipv6(const char *key, const char *value,
                return -1;
        }
 
-       lxc_list_add(&netdev->ipv6, list);
+       lxc_list_add_tail(&netdev->ipv6, list);
 
        free(valdup);
        return 0;