Skip to content

Commit

Permalink
selftests: router_bridge_vlan: Set vlan_default_pvid 0 on the bridge
Browse files Browse the repository at this point in the history
When everything is configured, VLAN membership on the bridge in this
selftest are as follows:

    # bridge vlan show
    port              vlan-id
    swp2              1 PVID Egress Untagged
                      555
    br1               1 Egress Untagged
                      555 PVID Egress Untagged

Note that it is possible for untagged traffic to just flow through as VLAN
1, instead of using VLAN 555 as intended by the test. This configuration
seems too close to "works by accident", and it would be better to just shut
out VLAN 1 altogether.

To that end, configure vlan_default_pvid of 0:

    # bridge vlan show
    port              vlan-id
    swp2              555
    br1               555 PVID Egress Untagged

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Petr Machata authored and David S. Miller committed Jun 5, 2023
1 parent 812de4d commit f513687
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ h2_destroy()

router_create()
{
ip link add name br1 type bridge vlan_filtering 1
ip link add name br1 type bridge vlan_filtering 1 vlan_default_pvid 0
ip link set dev br1 up

ip link set dev $swp1 master br1
Expand Down

0 comments on commit f513687

Please sign in to comment.