char veth1buf[IFNAMSIZ], *veth1;
char veth2[IFNAMSIZ];
- if (netdev->pair)
- veth1 = netdev->pair;
+ if (netdev->priv.pair)
+ veth1 = netdev->priv.pair;
else {
snprintf(veth1buf, sizeof(veth1buf), "vethXXXXXX");
mktemp(veth1buf);
return -1;
}
- snprintf(peer, sizeof(peer), "vlan%d",netdev->vlan_attr.vid);
+ snprintf(peer, sizeof(peer), "vlan%d",netdev->priv.vlan_attr.vid);
- if (lxc_vlan_create(netdev->link, peer, netdev->vlan_attr.vid)) {
+ if (lxc_vlan_create(netdev->link, peer, netdev->priv.vlan_attr.vid)) {
ERROR("failed to create vlan interface '%s' on '%s'",
peer, netdev->link);
return -1;
ushort pad;
};
+union netdev_p {
+ char *pair;
+ struct ifla_vlan vlan_attr;
+};
+
/*
* Defines a structure to configure a network device
* @link : lxc.network.link, name of bridge or host iface to attach if any
* @name : lxc.network.name, name of iface on the container side
- * @pair : lxc.network.pair, name of host-side iface in case of veth etc
* @flags : flag of the network device (IFF_UP, ... )
* @ipv4 : a list of ipv4 addresses to be set on the network device
* @ipv6 : a list of ipv6 addresses to be set on the network device
int ifindex;
char *link;
char *name;
- char *pair;
char *hwaddr;
char *mtu;
- struct ifla_vlan vlan_attr;
+ union netdev_p priv;
struct lxc_list ipv4;
struct lxc_list ipv6;
};
{ "lxc.network.flags", config_network_flags },
{ "lxc.network.link", config_network_link },
{ "lxc.network.name", config_network_name },
- { "lxc.network.pair", config_network_pair },
+ { "lxc.network.veth.pair", config_network_pair },
{ "lxc.network.hwaddr", config_network_hwaddr },
{ "lxc.network.mtu", config_network_mtu },
- { "lxc.network.vlanid", config_network_vlanid },
+ { "lxc.network.vlan.id", config_network_vlanid },
{ "lxc.network.ipv4", config_network_ipv4 },
{ "lxc.network.ipv6", config_network_ipv6 },
};
if (!netdev)
return -1;
- return network_ifname(&netdev->pair, value);
+ return network_ifname(&netdev->priv.pair, value);
}
static int config_network_hwaddr(const char *key, char *value,
if (!netdev)
return -1;
- if (get_u16(&netdev->vlan_attr.vid, value, 0))
+ if (get_u16(&netdev->priv.vlan_attr.vid, value, 0))
return -1;
return 0;