if (lxc_config_value_empty(value))
return clr_config_network_type(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
+
+ /* We maintain a negative count for legacy network devices. */
+ ssize_t negidx = -1;
WARN("WARNING: using \"lxc.network.type\" without an index "
"(e.g.\"lxc.network.0.type\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ if (!lxc_list_empty(&lxc_conf->network)) {
+ struct lxc_netdev *ndv;
+ ndv = lxc_list_first_elem(&lxc_conf->network);
+ if (ndv->idx < 0) {
+ negidx = ndv->idx;
+ negidx--;
+ }
+ }
+ if (negidx == INT_MIN) {
+ SYSERROR("number of configured networks would overflow "
+ "the counter... what are you doing?");
+ return -1;
+ }
+ netdev = lxc_network_add(&lxc_conf->network, negidx, false);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_flags(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.flags\" without an index "
"(e.g.\"lxc.network.0.flags\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
return 0;
}
-static int set_network_link(const char *key, const char *value,
- struct lxc_conf *lxc_conf, void *data)
-{
- struct lxc_netdev *netdev;
-
- /* lxc.network.* without an index */
- if (!data)
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
- else
- netdev = data;
- if (!netdev)
- return -1;
-
- return network_ifname(&netdev->link, value);
-}
-
static int create_matched_ifnames(const char *value, struct lxc_conf *lxc_conf,
struct lxc_netdev *netdev)
{
ret = set_config_network_type(type_key, tmpvalue,
lxc_conf, netdev);
if (!ret) {
- ret = set_network_link(link_key, ifa->ifa_name,
- lxc_conf, netdev);
+ ret = set_config_network_link(
+ link_key, ifa->ifa_name, lxc_conf, netdev);
if (ret) {
ERROR("failed to create matched ifnames");
break;
if (lxc_config_value_empty(value))
return clr_config_network_link(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.link\" without an index "
"(e.g.\"lxc.network.0.link\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_name(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.name\" without an index "
"(e.g.\"lxc.network.0.name\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_veth_pair(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.veth.pair\" without an "
"index (e.g. \"lxc.network.0.veth.pair\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
/* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.macvlan.mode\" without an "
"index (e.g. \"lxc.network.0.macvlan.mode\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_hwaddr(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.hwaddr\" without an index "
"(e.g. \"lxc.network.0.hwaddr\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_vlan_id(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.vlan.id\" without an index "
"(e.g. \"lxc.network.0.vlan.id\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_mtu(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.mtu\" without an index "
"(e.g. \"lxc.network.0.mtu\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_ipv4(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv4\" without an index "
"(e.g. \"lxc.network.0.ipv4\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_ipv4_gateway(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv4.gateway\" without an "
"index (e.g. \"lxc.network.0.ipv4.gateway\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_ipv6(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv6\" without an index "
"(e.g. \"lxc.network.0.ipv6\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_ipv6_gateway(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv6.gateway\" without an "
"index (e.g. \"lxc.network.0.ipv6.gateway\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_script_up(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.script.up\" without an "
"index (e.g. \"lxc.network.0.script.up\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
if (lxc_config_value_empty(value))
return clr_config_network_script_down(key, lxc_conf, data);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.script.down\" without an "
"index (e.g. \"lxc.network.0.script.down\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, true);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
static inline int clr_config_network(const char *key, struct lxc_conf *c,
void *data)
{
- lxc_free_networks(c);
+ lxc_free_networks(&c->network);
+
return 0;
}
/* This, of course is utterly nonsensical on so many levels, but
* better safe than sorry.
+ * (Checking for INT_MAX here is intentional.)
*/
- if (tmpidx == UINT_MAX) {
+ if (tmpidx == INT_MAX) {
SYSERROR(
"number of configured networks would overflow the "
"counter... what are you doing?");
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.type\" without an index "
"(e.g. \"lxc.network.0.type\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.name\" without an index "
"(e.g. \"lxc.network.0.name\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.flags\" without an index "
"(e.g. \"lxc.network.0.flags\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.link\" without an index "
"(e.g. \"lxc.network.0.link\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.macvlan.mode\" without an "
"index (e.g. \"lxc.network.0.macvlan.mode\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.veth.pair\" without an "
"index (e.g. \"lxc.network.0.veth.pair\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.script.up\" without an "
"index (e.g. \"lxc.network.0.script.up\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.script.down\" without an "
"index (e.g. \"lxc.network.0.script.down\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.hwaddr\" without an index "
"(e.g. \"lxc.network.0.hwaddr\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.mtu\" without an index "
"(e.g. \"lxc.network.0.mtu\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.vlan.id\" without an index "
"(e.g. \"lxc.network.0.vlan.id\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv4.gateway\" without an "
"index (e.g. \"lxc.network.0.ipv4.gateway\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
struct lxc_netdev *netdev;
struct lxc_list *cur, *next;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv4\" without an index "
"(e.g. \"lxc.network.0.ipv4\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
{
struct lxc_netdev *netdev;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv6.gateway\" without an "
"index (e.g. \"lxc.network.0.ipv6.gateway\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
struct lxc_netdev *netdev;
struct lxc_list *cur, *next;
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv6\" without an index "
"(e.g. \"lxc.network.0.ipv6\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0, false);
+ netdev = lxc_list_first_elem(&lxc_conf->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.type\" without an index "
"(e.g. \"lxc.network.0.type\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.flags\" without an index "
"(e.g. \"lxc.network.0.flags\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.link\" without an index "
"(e.g. \"lxc.network.0.link\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.name\" without an index "
"(e.g. \"lxc.network.0.name\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.macvlan.mode\" without an "
"index (e.g. \"lxc.network.0.macvlan.mode\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.veth.pair\" without an "
"index (e.g. \"lxc.network.0.veth.pair\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.script.up\" without an "
"index (e.g. \"lxc.network.0.script.up\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.script.down\" without an "
"index (e.g. \"lxc.network.0.script.down\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.hwaddr\" without an index "
"(e.g. \"lxc.network.0.hwaddr\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.mtu\" without an index "
"(e.g. \"lxc.network.0.mtu\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.vlan.id\" without an index "
"(e.g. \"lxc.network.0.vlan.id\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv4.gateway\" without an "
"index (e.g. \"lxc.network.0.ipv4.gateway\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv4\" without an index "
"(e.g. \"lxc.network.0.ipv4\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv6.gateway\" without an "
"index (e.g. \"lxc.network.0.ipv6.gateway\" is "
"DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}
else
memset(retv, 0, inlen);
- /* lxc.network.* without an index */
if (!data) {
+ /* REMOVE IN LXC 3.0:
+ * lxc.network.* without an index
+ */
WARN("WARNING: using \"lxc.network.ipv6\" without an index "
"(e.g. \"lxc.network.0.ipv6\") is DEPRECATED.");
- netdev = lxc_get_netdev_by_idx(c, 0, false);
+ netdev = lxc_list_first_elem(&c->network);
} else {
netdev = data;
}