bisdn / basebox

A tiny OpenFlow controller for OF-DPA switches.
Mozilla Public License 2.0
45 stars 9 forks source link

nl_bridge: unbreak handling of bridge vlan changes with multiple vlans #352

Closed KanjiMonster closed 2 years ago

KanjiMonster commented 2 years ago

When adding handling of untagged changes, it accidentially got added to the loop processing the vlan diff, causing it to abort after the first vlan, since it will process all untagged changes, then set done and abort.

Fix this by moving the untagged_diff handling out of the vlan_diff handling loop, so they cannot interfere with each other.

Config:

$ bridge vlan show port vlan-id swbridge 100 101 102 111 port54 100 101 102 110 111 112

Before:

$ client_flowtable_dump Table ID 10 (VLAN): Retrieving all entries. Max entries = 16384, Current entries = 1. -- inPort = 54 (Physical) vlanId:mask = 0x1064:0x1fff (VLAN 100) | GoTo = 20 (Termination MAC) | priority = 3 hard_time = 0 idle_time = 0 cookie = 8

After:

$ client_flowtable_dump Table ID 10 (VLAN): Retrieving all entries. Max entries = 16384, Current entries = 6. -- inPort = 54 (Physical) vlanId:mask = 0x1064:0x1fff (VLAN 100) | GoTo = 20 (Termination MAC) | priority = 3 hard_time = 0 idle_time = 0 cookie = 8 -- inPort = 54 (Physical) vlanId:mask = 0x1065:0x1fff (VLAN 101) | GoTo = 20 (Termination MAC) | priority = 3 hard_time = 0 idle_time = 0 cookie = 10 -- inPort = 54 (Physical) vlanId:mask = 0x1066:0x1fff (VLAN 102) | GoTo = 20 (Termination MAC) | priority = 3 hard_time = 0 idle_time = 0 cookie = 12 -- inPort = 54 (Physical) vlanId:mask = 0x106e:0x1fff (VLAN 110) | GoTo = 20 (Termination MAC) | priority = 3 hard_time = 0 idle_time = 0 cookie = 14 -- inPort = 54 (Physical) vlanId:mask = 0x106f:0x1fff (VLAN 111) | GoTo = 20 (Termination MAC) | priority = 3 hard_time = 0 idle_time = 0 cookie = 16 -- inPort = 54 (Physical) vlanId:mask = 0x1070:0x1fff (VLAN 112) | GoTo = 20 (Termination MAC) | priority = 3 hard_time = 0 idle_time = 0 cookie = 18

Fixes: bce2a11 ("nl_bridge: implement processing of untagged changes") Signed-off-by: Jonas Gorski jonas.gorski@bisdn.de

Description

Motivation and Context

How Has This Been Tested?