diff options
author | Susant Sahani <ssahani@users.noreply.github.com> | 2017-05-09 18:25:11 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-05-09 20:25:11 +0200 |
commit | 6c1ff21b008fafd8bcea8fc11b61233719c84951 (patch) | |
tree | 1c87043cff7010c6e024dc62141c78c2ee655813 /src/network | |
parent | 09b69d68faf054e9ec1327aee716b9be7210d709 (diff) | |
download | systemd-6c1ff21b008fafd8bcea8fc11b61233719c84951.tar.gz systemd-6c1ff21b008fafd8bcea8fc11b61233719c84951.tar.bz2 systemd-6c1ff21b008fafd8bcea8fc11b61233719c84951.zip |
network: add support for vlan confs(MVRP, reorder header, loose binding) (#5834)
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/netdev/netdev-gperf.gperf | 3 | ||||
-rw-r--r-- | src/network/netdev/vlan.c | 18 | ||||
-rw-r--r-- | src/network/netdev/vlan.h | 3 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index ed943789d7..766e7cf9fa 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -38,6 +38,9 @@ NetDev.MTUBytes, config_parse_iec_size, 0, NetDev.MACAddress, config_parse_hwaddr, 0, offsetof(NetDev, mac) VLAN.Id, config_parse_vlanid, 0, offsetof(VLan, id) VLAN.GVRP, config_parse_tristate, 0, offsetof(VLan, gvrp) +VLAN.MVRP, config_parse_tristate, 0, offsetof(VLan, mvrp) +VLAN.LooseBinding, config_parse_tristate, 0, offsetof(VLan, loose_binding) +VLAN.ReorderHeader, config_parse_tristate, 0, offsetof(VLan, reorder_hdr) MACVLAN.Mode, config_parse_macvlan_mode, 0, offsetof(MacVlan, mode) MACVTAP.Mode, config_parse_macvlan_mode, 0, offsetof(MacVlan, mode) IPVLAN.Mode, config_parse_ipvlan_mode, 0, offsetof(IPVlan, mode) diff --git a/src/network/netdev/vlan.c b/src/network/netdev/vlan.c index 60d6343021..6f41633ead 100644 --- a/src/network/netdev/vlan.c +++ b/src/network/netdev/vlan.c @@ -45,6 +45,21 @@ static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_netlin SET_FLAG(flags.flags, VLAN_FLAG_GVRP, v->gvrp); } + if (v->mvrp != -1) { + flags.mask |= VLAN_FLAG_MVRP; + SET_FLAG(flags.flags, VLAN_FLAG_MVRP, v->mvrp); + } + + if (v->reorder_hdr != -1) { + flags.mask |= VLAN_FLAG_REORDER_HDR; + SET_FLAG(flags.flags, VLAN_FLAG_REORDER_HDR, v->reorder_hdr); + } + + if (v->loose_binding != -1) { + flags.mask |= VLAN_FLAG_LOOSE_BINDING; + SET_FLAG(flags.flags, VLAN_FLAG_LOOSE_BINDING, v->loose_binding); + } + r = sd_netlink_message_append_data(req, IFLA_VLAN_FLAGS, &flags, sizeof(struct ifla_vlan_flags)); if (r < 0) return log_netdev_error_errno(netdev, r, "Could not append IFLA_VLAN_FLAGS attribute: %m"); @@ -78,6 +93,9 @@ static void vlan_init(NetDev *netdev) { v->id = VLANID_INVALID; v->gvrp = -1; + v->mvrp = -1; + v->loose_binding = -1; + v->reorder_hdr = -1; } const NetDevVTable vlan_vtable = { diff --git a/src/network/netdev/vlan.h b/src/network/netdev/vlan.h index 19a62b76c1..780d61262a 100644 --- a/src/network/netdev/vlan.h +++ b/src/network/netdev/vlan.h @@ -29,6 +29,9 @@ struct VLan { uint16_t id; int gvrp; + int mvrp; + int loose_binding; + int reorder_hdr; }; DEFINE_NETDEV_CAST(VLAN, VLan); |