fff-vxlan-node: do not set vid if GW not reachable

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Acked-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
Robert Langhammer 2022-03-24 09:26:08 +01:00 committed by Fabian Bläse
parent 7947107ed3
commit 4cd3b17714
1 changed files with 1 additions and 1 deletions

View File

@ -6,10 +6,10 @@ vxlan_clear() {
}
vxlan_addpeer() {
uci set network.vxlan0.vid="$id"
json_get_var address address
address=$(ping6 -w1 -c1 "$address" | awk '/from/ {print substr($4, 1, length($4)-1); exit}')
[ -z $address ] && return ## address not reachable
uci set network.vxlan0.vid="$id"
uci add network vxlan_peer
uci set network.@vxlan_peer[-1].vxlan="vxlan0"
uci set network.@vxlan_peer[-1].dst="$address"