[1/2] configurehood: Wait with hood file retrieval to allow deletion

Submitted by Adrian Schmutzler on March 8, 2018, 8:24 p.m.

Details

Message ID 1520540695-4303-1-git-send-email-freifunk@adrianschmutzler.de
State Rejected
Headers show

Commit Message

Adrian Schmutzler March 8, 2018, 8:24 p.m.
If we have a pool of routers connected by LAN, but without uplink,
they will loose gateway connection on a serious reconfiguration.

Then the routers should be able to delete their $hoodfilecopy
before it is access by other routers looking for a file.

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

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 1b9fa2b..127ce5b 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -137,7 +137,12 @@  else
 				wget -T15 -t5 "http://[fe80::1%w2sta]:2342/sectorfile" -O "$sectortmp" || wget -T15 -t5 "http://[fe80::1%w5sta]:2342/sectorfile" -O "$sectortmp"
 			fi
 		else
-			echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
+			echo "We have a Gateway in Range, we load the keyxchangev2data from network or gateway"
+
+			# We wait some time, so nodes without network connection can delete their $hoodfilecopy
+			# -> as a consequence, all hood files in the wired network are from devices with gateway connection
+			sleep 20;
+
 			# check eth first
 			oldhood=""
 			ethfile="${hoodfile}eth"

Comments

Tim Niemeyer March 16, 2018, 7:03 p.m.
Moin

Am Donnerstag, den 08.03.2018, 21:24 +0100 schrieb Adrian Schmutzler:
> If we have a pool of routers connected by LAN, but without uplink,
> they will loose gateway connection on a serious reconfiguration.
> 
> Then the routers should be able to delete their $hoodfilecopy
> before it is access by other routers looking for a file.
> 
> > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 1b9fa2b..127ce5b 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -137,7 +137,12 @@ else
> >  				wget -T15 -t5 "http://[fe80::1%w2sta]:2342/sectorfile" -O "$sectortmp" || wget -T15 -t5 "http://[fe80::1%w5sta]:2342/sectorfile" -O "$sectortmp"
> >  			fi
> >  		else
> > -			echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
> > +			echo "We have a Gateway in Range, we load the keyxchangev2data from network or gateway"
> +
> > +			# We wait some time, so nodes without network connection can delete their $hoodfilecopy
> > +			# -> as a consequence, all hood files in the wired network are from devices with gateway connection
> > +			sleep 20;

Wir sind hier an der Stelle, wo wir ein Gateway in der Nähe haben.
Gelöscht wird $hoodfilecopy auf einem Knoten, wenn es kein Gateway hat.
An der Stelle hier sind wir aber per Eth verbunden -> alle haben die
selben Gateways.

Tim

PS: Sleep ist keine Adäquate Lösung für Probleme der Nebenläufigkeit!

+
> >  			# check eth first
> >  			oldhood=""
> >  			ethfile="${hoodfile}eth"
> -- 
> 2.7.4
>
Adrian Schmutzler March 19, 2018, 3:54 p.m.
Hallo Tim,

ich glaube, du hast recht. Zumindest fällt mir kein Szenario (mehr) ein, das dem widerspricht.

Grüße

Adrian

> -----Original Message-----
> From: Tim Niemeyer [mailto:tim@tn-x.org]
> Sent: Freitag, 16. März 2018 20:04
> To: Adrian Schmutzler <freifunk@adrianschmutzler.de>; franken-
> dev@freifunk.net
> Subject: Re: [PATCH 1/2] configurehood: Wait with hood file retrieval to allow
> deletion
> 
> Moin
> 
> Am Donnerstag, den 08.03.2018, 21:24 +0100 schrieb Adrian Schmutzler:
> > If we have a pool of routers connected by LAN, but without uplink,
> > they will loose gateway connection on a serious reconfiguration.
> >
> > Then the routers should be able to delete their $hoodfilecopy before
> > it is access by other routers looking for a file.
> >
> > > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> > ---
> >  src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> > b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> > index 1b9fa2b..127ce5b 100755
> > --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> > +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> > @@ -137,7 +137,12 @@ else
> > >  				wget -T15 -t5
> "http://[fe80::1%w2sta]:2342/sectorfile" -O "$sectortmp" || wget -T15 -t5
> "http://[fe80::1%w5sta]:2342/sectorfile" -O "$sectortmp"
> > >  			fi
> > >  		else
> > > -			echo "We have a Gateway in Range, we load the
> keyxchangev2data from fe80::1"
> > > +			echo "We have a Gateway in Range, we load the
> keyxchangev2data from network or gateway"
> > +
> > > +			# We wait some time, so nodes without network
> connection can delete their $hoodfilecopy
> > > +			# -> as a consequence, all hood files in the wired
> network are from devices with gateway connection
> > > +			sleep 20;
> 
> Wir sind hier an der Stelle, wo wir ein Gateway in der Nähe haben.
> Gelöscht wird $hoodfilecopy auf einem Knoten, wenn es kein Gateway hat.
> An der Stelle hier sind wir aber per Eth verbunden -> alle haben die selben
> Gateways.
> 
> Tim
> 
> PS: Sleep ist keine Adäquate Lösung für Probleme der Nebenläufigkeit!
> 
> +
> > >  			# check eth first
> > >  			oldhood=""
> > >  			ethfile="${hoodfile}eth"
> > --
> > 2.7.4
> >