Compare commits

...

3 Commits

Author SHA1 Message Date
Robert Langhammer a29050b87f node-fff-hoods: Make keyserverurl configurable
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
2022-04-07 17:46:53 +02:00
Fabian Bläse 57408f5dfb fff-layer3-config: show uci syntax errors
Do not hide uci errors when checking if gateway config exists, so an
appropriate uci error message is displayed. This can be helpful to find
syntax errors.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <freifunk@dresel.systems>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-04-05 21:25:33 +02:00
Fabian Bläse b26399283a fff-ra: use dhcp leasetime for preferred and valid lifetime
When advertising network prefixes gathered from the interface, odhcpd
sets the preferred and valid lifetime of those prefixes in the router
advertisement to the values set for those addresses on the interface.

When prefixes are configured statically (as done in our firmware), this
means that odhcp announces these prefixes for SLAAC with infinite
preferred and valid lifetimes.

While this does not seem like a problem at first, it hurts significantly
when configuration errors are made or cables are plugged into the wrong
ports, because those addresses never vanish from devices anymore, as long
as they are powered up. Also, it makes it impossible to change prefixes
without gracefully shutting down the RA server, so it can announce zero
lifetimes for previously announced prefixes.

Sadly, odhcp does not have an option to configure these lifetimes
explicitly, but it is possible to limit these lifetimes to the lease
time configured and used for the DHCP functionality of odhcpd.
Enable the appropriate 'ra_useleasetime' option to reduce impact of the
before mentioned problems.

Fixes: #142

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <freifunk@dresel.systems>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-04-05 21:25:19 +02:00
3 changed files with 4 additions and 2 deletions

View File

@ -99,7 +99,8 @@ getKeyserverHoodfile() {
echo "Getting hoodfile from Keyserver"
if /bin/busybox wget -T15 -O "$file" "http://keyserver.freifunk-franken.de/v2/?lat=$lat&long=$long"; then
keyserverurl=$(uci -q get fff.keyserver.url)
if /bin/busybox wget -T15 -O "$file" "${keyserverurl:-http://keyserver.freifunk-franken.de/v2}/?lat=$lat&long=$long"; then
return 0
else
return 1

View File

@ -1,6 +1,6 @@
configure() {
# check if gateway config exists
if ! uci -q show gateway > /dev/null; then
if ! uci show gateway > /dev/null; then
echo "ERROR: Gateway config could not be parsed or does not exist."
return 1

View File

@ -4,6 +4,7 @@ uci batch <<EOF
set dhcp.client.ra='server'
set dhcp.client.ra_default='2'
set dhcp.client.ra_management='0'
set dhcp.client.ra_useleasetime='1'
EOF
exit 0