network: carry some structs to ease backports

parent 609c5019
...@@ -247,6 +247,7 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf) ...@@ -247,6 +247,7 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
switch (netdev->type) { switch (netdev->type) {
case LXC_NET_VETH: case LXC_NET_VETH:
TRACE("type: veth"); TRACE("type: veth");
TRACE("veth mode: %d", netdev->priv.veth_attr.mode);
if (netdev->priv.veth_attr.pair[0] != '\0') if (netdev->priv.veth_attr.pair[0] != '\0')
TRACE("veth pair: %s", TRACE("veth pair: %s",
...@@ -259,6 +260,15 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf) ...@@ -259,6 +260,15 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
if (netdev->priv.veth_attr.ifindex > 0) if (netdev->priv.veth_attr.ifindex > 0)
TRACE("host side ifindex for veth device: %d", TRACE("host side ifindex for veth device: %d",
netdev->priv.veth_attr.ifindex); netdev->priv.veth_attr.ifindex);
if (netdev->priv.veth_attr.vlan_id_set)
TRACE("veth vlan id: %d", netdev->priv.veth_attr.vlan_id);
lxc_list_for_each_safe(cur, &netdev->priv.veth_attr.vlan_tagged_ids, next) {
unsigned short vlan_tagged_id = PTR_TO_USHORT(cur->elem);
TRACE("veth vlan tagged id: %u", vlan_tagged_id);
}
break; break;
case LXC_NET_MACVLAN: case LXC_NET_MACVLAN:
TRACE("type: macvlan"); TRACE("type: macvlan");
...@@ -432,6 +442,11 @@ static void lxc_free_netdev(struct lxc_netdev *netdev) ...@@ -432,6 +442,11 @@ static void lxc_free_netdev(struct lxc_netdev *netdev)
free(cur->elem); free(cur->elem);
free(cur); free(cur);
} }
lxc_list_for_each_safe(cur, &netdev->priv.veth_attr.vlan_tagged_ids, next) {
lxc_list_del(cur);
free(cur);
}
} }
free(netdev); free(netdev);
......
...@@ -548,6 +548,34 @@ extern int __build_bug_on_failed; ...@@ -548,6 +548,34 @@ extern int __build_bug_on_failed;
#define IPVLAN_ISOLATION_VEPA 2 #define IPVLAN_ISOLATION_VEPA 2
#endif #endif
#ifndef BRIDGE_VLAN_NONE
#define BRIDGE_VLAN_NONE -1 /* Bridge VLAN option set to "none". */
#endif
#ifndef BRIDGE_VLAN_ID_MAX
#define BRIDGE_VLAN_ID_MAX 4094 /* Bridge VLAN MAX VLAN ID. */
#endif
#ifndef BRIDGE_FLAGS_MASTER
#define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from parent */
#endif
#ifndef BRIDGE_VLAN_INFO_PVID
#define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */
#endif
#ifndef BRIDGE_VLAN_INFO_UNTAGGED
#define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */
#endif
#ifndef IFLA_BRIDGE_FLAGS
#define IFLA_BRIDGE_FLAGS 0
#endif
#ifndef IFLA_BRIDGE_VLAN_INFO
#define IFLA_BRIDGE_VLAN_INFO 2
#endif
/* Attributes of RTM_NEWNSID/RTM_GETNSID messages */ /* Attributes of RTM_NEWNSID/RTM_GETNSID messages */
enum { enum {
__LXC_NETNSA_NONE, __LXC_NETNSA_NONE,
......
...@@ -80,6 +80,9 @@ struct ifla_veth { ...@@ -80,6 +80,9 @@ struct ifla_veth {
struct lxc_list ipv4_routes; struct lxc_list ipv4_routes;
struct lxc_list ipv6_routes; struct lxc_list ipv6_routes;
int mode; /* bridge, router */ int mode; /* bridge, router */
short vlan_id;
bool vlan_id_set;
struct lxc_list vlan_tagged_ids;
}; };
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