network: bridge vlan without PVID (#5899)
this patch makes it possible to configure a vlan aware bridge without the PVID. To configure no PVID set DefaultPVID=none in the [BridgeVLAN] section. fixes #5716
This commit is contained in:
committed by
Lennart Poettering
parent
defdbbb6dc
commit
0d6c68eba3
@@ -24,6 +24,7 @@
|
||||
#include "netlink-util.h"
|
||||
#include "netdev/bridge.h"
|
||||
#include "networkd-manager.h"
|
||||
#include "vlan-util.h"
|
||||
|
||||
/* callback for brige netdev's parameter set */
|
||||
static int netdev_bridge_set_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) {
|
||||
@@ -102,7 +103,7 @@ static int netdev_bridge_post_create(NetDev *netdev, Link *link, sd_netlink_mess
|
||||
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BR_PRIORITY attribute: %m");
|
||||
}
|
||||
|
||||
if (b->default_pvid > 0) {
|
||||
if (b->default_pvid != VLANID_INVALID) {
|
||||
r = sd_netlink_message_append_u16(req, IFLA_BR_VLAN_DEFAULT_PVID, b->default_pvid);
|
||||
if (r < 0)
|
||||
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BR_VLAN_DEFAULT_PVID attribute: %m");
|
||||
@@ -160,6 +161,7 @@ static void bridge_init(NetDev *n) {
|
||||
b->mcast_snooping = -1;
|
||||
b->vlan_filtering = -1;
|
||||
b->stp = -1;
|
||||
b->default_pvid = VLANID_INVALID;
|
||||
b->forward_delay = USEC_INFINITY;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ Bridge.MaxAgeSec, config_parse_sec, 0,
|
||||
Bridge.AgeingTimeSec, config_parse_sec, 0, offsetof(Bridge, ageing_time)
|
||||
Bridge.ForwardDelaySec, config_parse_sec, 0, offsetof(Bridge, forward_delay)
|
||||
Bridge.Priority, config_parse_uint16, 0, offsetof(Bridge, priority)
|
||||
Bridge.DefaultPVID, config_parse_vlanid, 0, offsetof(Bridge, default_pvid)
|
||||
Bridge.DefaultPVID, config_parse_default_port_vlanid, 0, offsetof(Bridge, default_pvid)
|
||||
Bridge.MulticastQuerier, config_parse_tristate, 0, offsetof(Bridge, mcast_querier)
|
||||
Bridge.MulticastSnooping, config_parse_tristate, 0, offsetof(Bridge, mcast_snooping)
|
||||
Bridge.VLANFiltering, config_parse_tristate, 0, offsetof(Bridge, vlan_filtering)
|
||||
|
||||
Reference in New Issue
Block a user