Commit 0e7a504c authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

selftests: forwarding: lib: Support VLAN devices

Add vlan_create() and vlan_destroy() to manage VLAN netdevices.
Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 91bac7f9
...@@ -340,6 +340,31 @@ tunnel_destroy() ...@@ -340,6 +340,31 @@ tunnel_destroy()
ip link del dev $name ip link del dev $name
} }
vlan_create()
{
local if_name=$1; shift
local vid=$1; shift
local vrf=$1; shift
local ips=("${@}")
local name=$if_name.$vid
ip link add name $name link $if_name type vlan id $vid
if [ "$vrf" != "" ]; then
ip link set dev $name master $vrf
fi
ip link set dev $name up
__addr_add_del $name add "${ips[@]}"
}
vlan_destroy()
{
local if_name=$1; shift
local vid=$1; shift
local name=$if_name.$vid
ip link del dev $name
}
master_name_get() master_name_get()
{ {
local if_name=$1 local if_name=$1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment