From 5cd46fb17b889f85f62276faf62ffa32d559000f Mon Sep 17 00:00:00 2001 From: Fabian Blaese Date: Wed, 6 May 2020 16:48:01 +0200 Subject: [PATCH] fff-hoods: Remove hardcoded IPv4 address and foreign domain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IPv4 is not a requirement for VPN nodes. However, a working DNS is a requirement for nodes connecting via VPN. Therefore the hardcoded IPv4 address is removed from the internet test. To improve readability, a loop is used instead of having a seperate ping command for each host. The ping utility built into our firmware supports both IPv4 and IPv6. Signed-off-by: Fabian Bläse Reviewed-by: Robert Langhammer Reviewed-by: Adrian Schmutzler [bump PKG_RELEASE] Signed-off-by: Adrian Schmutzler --- src/packages/fff/fff-hoods/Makefile | 2 +- .../fff/fff-hoods/files/usr/sbin/configurehood | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/packages/fff/fff-hoods/Makefile b/src/packages/fff/fff-hoods/Makefile index a055fa2..309e354 100644 --- a/src/packages/fff/fff-hoods/Makefile +++ b/src/packages/fff/fff-hoods/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-hoods -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood index 8c7bb3d..3b92cbc 100755 --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood @@ -31,14 +31,10 @@ isGatewayAvailable() { # Ping test hasInternet() { - test_ipv4_host1="keyserver.freifunk-franken.de" # Freifunk-Franken keyserver - test_ipv4_host2="8.8.8.8" # Google DNS - test_ipv6_host1="heise.de" # heise Zeitschriftenverlag - if ping -w5 -c3 "$test_ipv4_host1" &>/dev/null || - ping -w5 -c3 "$test_ipv4_host2" &>/dev/null || - ping6 -w5 -c3 "$test_ipv6_host1" &>/dev/null ; then - return 0 - fi + internetAddresses="keyserver.freifunk-franken.de heise.de" + for addr in $internetAddresses; do + ping -w5 -c3 "$addr" &>/dev/null && return 0 + done return 1 }