network: add ifindex field for host veth device

We should not just record the ifindex for the container's veth device but also for the host's veth device. This is useful when {configuring,deconfiguring} veth devices and becomes crucial when calling our lxc-user-nic setuid helper where we rely on the ifindex to make decisions about whether we are licensed to perform certain operations on the veth device in question. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 8ce727fc
...@@ -79,9 +79,21 @@ struct lxc_route6 { ...@@ -79,9 +79,21 @@ struct lxc_route6 {
struct in6_addr addr; struct in6_addr addr;
}; };
/* Contains information about the host side veth device.
* @pair : Name of the host side veth device.
* If the user requested that the host veth device be created with a
* specific names this field will be set. If this field is set @veth1
* is not set.
* @veth1 : Name of the host side veth device.
* If the user did not request that the host veth device be created
* with a specific name this field will be set. If this field is set
* @pair is not set.
* @ifindex : Ifindex of the network device.
*/
struct ifla_veth { struct ifla_veth {
char *pair; /* pair name */ char *pair;
char veth1[IFNAMSIZ]; /* needed for deconf */ char veth1[IFNAMSIZ];
int ifindex;
}; };
struct ifla_vlan { struct ifla_vlan {
......
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