Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0
0003 
0004 # Check FDB default-remote handling across "ip link set".
0005 
0006 check_remotes()
0007 {
0008         local what=$1; shift
0009         local N=$(bridge fdb sh dev vx | grep 00:00:00:00:00:00 | wc -l)
0010 
0011         echo -ne "expected two remotes after $what\t"
0012         if [[ $N != 2 ]]; then
0013                 echo "[FAIL]"
0014                 EXIT_STATUS=1
0015         else
0016                 echo "[ OK ]"
0017         fi
0018 }
0019 
0020 ip link add name vx up type vxlan id 2000 dstport 4789
0021 bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.20 self permanent
0022 bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.30 self permanent
0023 check_remotes "fdb append"
0024 
0025 ip link set dev vx type vxlan remote 192.0.2.30
0026 check_remotes "link set"
0027 
0028 ip link del dev vx
0029 exit $EXIT_STATUS