Commit 11029c02 by Dwight Engen Committed by Serge Hallyn

return lxc generated name for veth pair

Doing a get_config_item for lxc.network.0.veth.pair only returns the pair name if explicitly given, but it can be useful to know the name even if it is the one that lxc autogenerated. Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 40650ea6
......@@ -1705,8 +1705,12 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen,
strprint(retv, inlen, "%s", mode);
}
} else if (strcmp(p1, "veth.pair") == 0) {
if (netdev->type == LXC_NET_VETH && netdev->priv.veth_attr.pair)
strprint(retv, inlen, "%s", netdev->priv.veth_attr.pair);
if (netdev->type == LXC_NET_VETH) {
strprint(retv, inlen, "%s",
netdev->priv.veth_attr.pair ?
netdev->priv.veth_attr.pair :
netdev->priv.veth_attr.veth1);
}
} else if (strcmp(p1, "vlan") == 0) {
if (netdev->type == LXC_NET_VLAN) {
strprint(retv, inlen, "%d", netdev->priv.vlan_attr.vid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment