mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 07:00:05 +01:00
bridge: fix reapplying port VLANs
If the bridge default-pvid is zero, it means that the default PVID is
disabled. That is, the bridge PVID is not propagated to ports.
Currently NM tries to merge the existing bridge VLANs on the port with
the default PVID from the bridge, even when the PVID is zero. This
causes an error when setting the new VLAN list in the kernel, because
it rejects VLAN zero.
Skip the merge of the default PVID when zero.
Fixes: c5d1e35f99 ('device: support reapplying bridge-port VLANs')
This commit is contained in:
parent
f655cd1cba
commit
bf79fbd678
1 changed files with 5 additions and 0 deletions
|
|
@ -735,6 +735,11 @@ merge_bridge_vlan_default_pvid(NMPlatformBridgeVlan *vlans, guint *num_vlans, gu
|
|||
gboolean has_pvid = FALSE;
|
||||
guint i;
|
||||
|
||||
if (default_pvid == 0) {
|
||||
/* default_pvid=0 means that the default PVID is disabled. No need to merge it. */
|
||||
return vlans;
|
||||
}
|
||||
|
||||
for (i = 0; i < *num_vlans; i++) {
|
||||
if (vlans[i].pvid) {
|
||||
has_pvid = TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue