[PATCH] fff-hoods: Remove gateway-up condition for hidden AP

Christian Dresel fff at chrisi01.de
Di Okt 31 08:28:09 CET 2017


Hallo Adrian

diesen Fall hatte ich tatsächlich auch schon mal, hab aber nie genau
drauf geguckt warum das passiert ist.

Die Abfrage is GatewayAvailable hatte den Grund, das man das Timeouts
der Gateways mit abfangen möchte.

Flag wird gesetzt wenn GW da ist
5min später
Flag wird geprüft UND wenn GW immer noch da ist, ist es kein Timeout und
configap wird geöffnet

du machst nun ein:
Flag wird gesetzt wenn GW da ist
5min später
Flag wird geprüft und es wird auf jeden Fall configap geöffnet obwohl
vielleicht schon kein GW mehr da ist (weil es vllt. im ersten Fall schon
Richtung Timeout lief...)

mfg

Christian


On 27.10.2017 20:16, Adrian Schmutzler wrote:
> Since the hidden AP clause is entered only once, there may be a case where
> the router has been set up and hiddenapfile created, but the gateway being
> temporarily unavailable. In this case, no configap would be set up.
> 
> This can be easily fixed by removing the gateway-available condition.
> In fact, removing this has no negative side effects, as if the gateway
> would be permanently off, the router would go into wXsta mode and
> configap would be destroyed again anyway.
> 
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> ---
>  .../fff/fff-hoods/files/usr/sbin/configurehood     | 35 ++++++++++------------
>  1 file changed, 16 insertions(+), 19 deletions(-)
> 
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 1eadc41..19a498a 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -38,26 +38,23 @@ hasInternet() {
>  # Hidden AP check
>  
>  if [ -f "$hiddenapfile" ]; then
> -	if isGatewayAvailable ; then
> -
> -		for radio in $(uci show wireless | sed -n 's,.*\.\([a-z0-9]*\)=wifi-device,\1,p'); do
> -			channel=$(uci get "wireless.${radio}.channel")
> -			iface="configap2"
> -			if [ "$channel" -gt "14" ]; then
> -				iface="configap5"
> -			fi
> -			uci set network.${iface}=interface
> -			uci set network.${iface}.proto='static'
> -			uci set network.${iface}.ip6addr='fe80::1/64'
> -			if ! wifiAddAP "$radio" "config.franken.freifunk.net" "$iface" "configap" "1"; then
> -				echo "Can't add Config interface on $radio."
> -				exit 1
> -			fi
> -		done
> -		uci commit network
> +	for radio in $(uci show wireless | sed -n 's,.*\.\([a-z0-9]*\)=wifi-device,\1,p'); do
> +		channel=$(uci get "wireless.${radio}.channel")
> +		iface="configap2"
> +		if [ "$channel" -gt "14" ]; then
> +			iface="configap5"
> +		fi
> +		uci set network.${iface}=interface
> +		uci set network.${iface}.proto='static'
> +		uci set network.${iface}.ip6addr='fe80::1/64'
> +		if ! wifiAddAP "$radio" "config.franken.freifunk.net" "$iface" "configap" "1"; then
> +			echo "Can't add Config interface on $radio."
> +			exit 1
> +		fi
> +	done
> +	uci commit network
>  
> -		wifi
> -	fi
> +	wifi
>  	rm "$hiddenapfile"
>  fi
>  
> 

-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 833 bytes
Beschreibung: OpenPGP digital signature
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171031/e5b832ac/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev