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: Christian Brauner <christian.brauner@ubuntu.com>
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 {
- char *pair; /* pair name */
- char veth1[IFNAMSIZ]; /* needed for deconf */
+ char *pair;
+ char veth1[IFNAMSIZ];
+ int ifindex;
};
struct ifla_vlan {