Skip to content

Commit

Permalink
net: bridge: vlan: fix global vlan option range dumping
Browse files Browse the repository at this point in the history
When global vlan options are equal sequentially we compress them in a
range to save space and reduce processing time. In order to have the
proper range end id we need to update range_end if the options are equal
otherwise we get ranges with the same end vlan id as the start.

Fixes: 743a53d ("net: bridge: vlan: add support for dumping global vlan options")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Link: https://lore.kernel.org/r/20210810092139.11700-1-razor@blackwall.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Nikolay Aleksandrov authored and kuba-moo committed Aug 11, 2021
1 parent 83f0a0b commit 6c4110d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/bridge/br_vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ static int br_vlan_dump_dev(const struct net_device *dev,

if (dump_global) {
if (br_vlan_global_opts_can_enter_range(v, range_end))
continue;
goto update_end;
if (!br_vlan_global_opts_fill(skb, range_start->vid,
range_end->vid,
range_start)) {
Expand All @@ -2045,6 +2045,7 @@ static int br_vlan_dump_dev(const struct net_device *dev,

range_start = v;
}
update_end:
range_end = v;
}

Expand Down

0 comments on commit 6c4110d

Please sign in to comment.