diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index f9b558520b..71cf2f2a50 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -410,6 +410,31 @@ the kernel's default setting applies. + + MVRP= + + Multiple VLAN Registration Protocol (MVRP) formerly known as GARP VLAN + Registration Protocol (GVRP) is a standards-based Layer 2 network protocol, + for automatic configuration of VLAN information on switches. It was defined + in the 802.1ak amendment to 802.1Q-2005. A boolean. When unset, the kernel's + default setting applies. + + + + LooseBinding= + + The VLAN loose binding mode, in which only the operational state is passed + from the parent to the associated VLANs, but the VLAN device state is not changed. + A boolean. When unset, the kernel's default setting applies. + + + + ReorderHeader= + + The VLAN reorder header is set VLAN interfaces behave like physical interfaces. + A boolean. When unset, the kernel's default setting applies. + + 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);