2 # SPDX-License-Identifier: GPL-2.0
15 simple_if_init
$h1 192.0.2.1/28 2001:db8
:1::1/64
16 vlan_create
$h1 85 v
$h1 192.0.2.17/28 2001:db8
:2::1/64
22 simple_if_fini
$h1 192.0.2.1/28 2001:db8
:1::1/64
27 simple_if_init
$h2 192.0.2.2/28 2001:db8
:1::2/64
28 vlan_create
$h2 65 v
$h2 192.0.2.18/28 2001:db8
:2::2/64
34 simple_if_fini
$h2 192.0.2.2/28 2001:db8
:1::2/64
39 ip link add dev br0
type bridge vlan_filtering
1 mcast_snooping
0
41 ip link
set dev
$swp1 master br0
42 ip link
set dev
$swp2 master br0
44 ip link
set dev br0 up
45 ip link
set dev
$swp1 up
46 ip link
set dev
$swp2 up
48 bridge vlan add dev
$swp1 vid
85
49 bridge vlan add dev
$swp2 vid
65
51 bridge vlan add dev
$swp2 vid
85
52 bridge vlan add dev
$swp1 vid
65
54 tc qdisc add dev
$swp1 clsact
55 tc qdisc add dev
$swp2 clsact
60 tc qdisc del dev
$swp2 clsact
61 tc qdisc del dev
$swp1 clsact
63 bridge vlan del vid
65 dev
$swp1
64 bridge vlan del vid
85 dev
$swp2
66 bridge vlan del vid
65 dev
$swp2
67 bridge vlan del vid
85 dev
$swp1
69 ip link
set dev
$swp2 down
70 ip link
set dev
$swp1 down
103 vlan_modify_ingress
()
107 ping_do
$h1.85
192.0.2.18
108 check_fail $?
"ping between two different vlans passed when should not"
110 ping6_do
$h1.85
2001:db8
:2::2
111 check_fail $?
"ping6 between two different vlans passed when should not"
113 tc filter add dev
$swp1 ingress protocol all pref
1 handle
1 \
114 flower action vlan modify id
65
115 tc filter add dev
$swp2 ingress protocol all pref
1 handle
1 \
116 flower action vlan modify id
85
118 ping_do
$h1.85
192.0.2.18
119 check_err $?
"ping between two different vlans failed when should not"
121 ping6_do
$h1.85
2001:db8
:2::2
122 check_err $?
"ping6 between two different vlans failed when should not"
124 log_test
"VLAN modify at ingress"
126 tc filter del dev
$swp2 ingress protocol all pref
1 handle
1 flower
127 tc filter del dev
$swp1 ingress protocol all pref
1 handle
1 flower
134 ping_do
$h1.85
192.0.2.18
135 check_fail $?
"ping between two different vlans passed when should not"
137 ping6_do
$h1.85
2001:db8
:2::2
138 check_fail $?
"ping6 between two different vlans passed when should not"
140 tc filter add dev
$swp1 egress protocol all pref
1 handle
1 \
141 flower action vlan modify id
85
142 tc filter add dev
$swp2 egress protocol all pref
1 handle
1 \
143 flower action vlan modify id
65
145 ping_do
$h1.85
192.0.2.18
146 check_err $?
"ping between two different vlans failed when should not"
148 ping6_do
$h1.85
2001:db8
:2::2
149 check_err $?
"ping6 between two different vlans failed when should not"
151 log_test
"VLAN modify at egress"
153 tc filter del dev
$swp2 egress protocol all pref
1 handle
1 flower
154 tc filter del dev
$swp1 egress protocol all pref
1 handle
1 flower