fff-hoods: Fix resetting interfaces during connection drop

Submitted by Adrian Schmutzler on Oct. 5, 2017, 10:14 p.m.

Details

Message ID 1507241691-21754-1-git-send-email-freifunk@adrianschmutzler.de
State Superseded
Headers show

Commit Message

Adrian Schmutzler Oct. 5, 2017, 10:14 p.m.
This addresses the following case:
A mesh router has been connected to an uplink router and
downloaded the json. Now the uplink goes down and the mesh router
deletes (!) all interfaces to put up only w2sta. If now the
connection is reestablished, the new json is downloaded and
compared to the still present old one. If the new json does
not differ from the old one, no recreation of wXap and wXmesh
is triggered.
Thus I delete the old file if connection is lost, so comparison
always enters the clause then.

Apply only after the keyV2 patch set!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
index 8155111..6dc1b68 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -66,6 +66,8 @@  else
 	if ! isGatewayAvailable ; then
 		#now we haven't a gateway in Range, we search for a hidden AP to get a keyxchangev2data file!
 		#first we delete all wifi settings
+		rm /www/public/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
+
 		if ! wifiDelAll; then
 			echo "Can't delete current wifi setup"
 			exit 1

Comments

Christian Dresel Oct. 10, 2017, 12:45 p.m.
hi

Reviewed-by: Christian Dresel <fff@chrisi01.de>

ganz allgemein (neben den beschrieben Problem) macht es sowieso Sinn,
die File zu entfernen wenn kein GW mehr da ist da sie ja dann
höchstwarscheinlich ungültig/Fehlerhaft/whatever ist.

mfg

Christian

On 06.10.2017 00:14, Adrian Schmutzler wrote:
> This addresses the following case:
> A mesh router has been connected to an uplink router and
> downloaded the json. Now the uplink goes down and the mesh router
> deletes (!) all interfaces to put up only w2sta. If now the
> connection is reestablished, the new json is downloaded and
> compared to the still present old one. If the new json does
> not differ from the old one, no recreation of wXap and wXmesh
> is triggered.
> Thus I delete the old file if connection is lost, so comparison
> always enters the clause then.
> 
> Apply only after the keyV2 patch set!
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 8155111..6dc1b68 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -66,6 +66,8 @@ else
>  	if ! isGatewayAvailable ; then
>  		#now we haven't a gateway in Range, we search for a hidden AP to get a keyxchangev2data file!
>  		#first we delete all wifi settings
> +		rm /www/public/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
> +
>  		if ! wifiDelAll; then
>  			echo "Can't delete current wifi setup"
>  			exit 1
>