Commit Graph

526 Commits

Author SHA1 Message Date
Adrian Schmutzler 6c947f8c91 fff-hoods: Replace wifi command with reload_config
If wireless config has changed, reload_config will automatically
adjust wireless interfaces.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler a8f7dce6fc vpn-select: indent contents of make_config function
This is a purely cosmetic change to enhance the readability
of the function.

Also add some empty lines and comments for overview.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 91808ad710 nodewatcher: Use Makefile version for nodewatcher data
So far, nodewatcher version has to be specified twice, once in the
Makefile and again in the nodewatcher script.

With this patch, a version file is created during build than can
be read in nodewatcher script, so version only has to be specified
once anymore. The file name mimics the version files already present
for OpenWrt and our firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 498c6ad963 fff-nodewatcher: Consolidate code in nodewatcher.d/10-systemdata.sh
This consolidates the code in nodewatcher.d/10-systemdata.sh by:

- Slightly reordering data retrieval
- Moving XML node assembly to corresponding data retrieval, making
  the whole file easier to read
- Changing some if statements to shorter binary condition shortcuts
- Reduce the number of variables by merging some code into the XML
  node assembly

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 18e00a4e70 nodewatcher.d: Tiny cosmetic improvements
This applies some tiny improvements to just-moved nodewatcher.d code:

- Remove comments about obvious things
- Introduce newlines to make code easier to read
- Use shorter conditional syntax for easy cases

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 1c3243dd18 fff-nodewatcher: Tidy up uci-defaults script
This solves the following issues with the uci-defaults script in
fff-nodewatcher:

- Remove /bin/sh in non-executable file
- Only commit to changed config
- Use "-1" for uci node indexing, as this will be the node just
  created

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Tim Niemeyer b6c7acd704 nodewatcher: split into nodewatcher.d scripts for individual task
This splits up the data extraction/assembly of the nodewatcher
script into several parts and distributes them across packages, so
that each nodewatcher.d subscript is located in the package providing
the relevant functionality. This allows to extend the nodewatcher data
by enabling/disabling packages.
This scheme is not perfectly fulfilled for fff-network vs. fff-wireless,
as data cannot uniquely assigned there and the XML syntax does not allow
separation anyway.

In general, this moves code without applying code improvements, yielding
at an easy comparison of moved fragments. However, the following changes
were done to improve experience:

- The function writing debug output has been renamed from "err" to "debug"
- Since we catch the stdout of the nodewatcher.d functions anyway,
  those scripts were adjusted to echo output directly instead of first
  writing it into a variable and then outputting it at the end.
- The uci config has been kept, but initialization for the network part
  has been moved to the fff-network package.
- Space indent has been changed to tab, which is more common in the
  firmware and requires less space.
- Remove support for nodewatcher run without uci config. Script-based
  nodewatcher on other platforms will have altered code anyway, and
  splitting it up will prevent effective use as a blueprint for those
  cases. After this change, nodewatcher in firmware is supposed to be
  used only for this firmware.

Note that since the nodewatcher.d scripts are evaluated by using their
echo output, having a function created uncaught output to stdout there
will corrupt the XML.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
[rebase and adjustments for current master, use simpler mechanism to
call nodewatcher.d scripts, use tab indent, remove debug() definition
where not needed, do not remove uci config, add commit message, use
echo -n]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[remove 'local' modifier for variable not inside a function, fix typo]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Fabian Bläse 9957cd4318 fff-gateway: make uci query for vlan ports quiet
The user might create a vlan without any ports.
This setup lead to "uci: Entry not found" error messages,
while still working as intended.

The '-q' flag is added to the corresponding uci query to
hide this error. While this isn't strictly necessary, the
uci subcommand is quoted to bring it in line with the other
subcommands.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-17 17:08:16 +02:00
Johannes Kimmel a16800c683 fff-gateway: add vxlan package
This adds vxlan support to facilitate testing future uses for vxlan.

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-15 16:21:29 +02:00
Dominik Heidler 9343153547 ramips/mt76x8: Add support for TP-Link TL-WR841N v13
Flashing instructions:

The image can only be flashed via TFTP, not via WebUI.

1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "...-tftp-recovery.bin" to "tp_recovery.bin" and place
   it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.

ref: 24043a0d2e

Signed-off-by: Dominik Heidler <dominik@heidler.eu>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[add commit message, rebase]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-15 16:08:44 +02:00
Fabian Bläse d165915178 ramips/mt76x8: Add support for TP-Link Archer C50 v3
This adds support for the TP-Link Archer C50 v3 and adds the
necessary mt76x8 (sub-)target to our firmare.

Flashing instructions:

The image can only be flashed via TFTP, not via WebUI.

1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "...-tftp-recovery.bin" to "tp_recovery.bin" and place it
   in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.

ref: 14951e8f8e

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[extend commit title and add commit message, rebase]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-15 16:08:28 +02:00
Adrian Schmutzler eb784bd0db fff-sysupgrade: replace comma by underscore in image file names
On modern targets in OpenWrt, the board name follows the
"vendor,model" syntax. Since commas in file names are uncommon
and ugly, file names use the same pattern with an underscore,
"vendor_model".

Since this also applies to image file names, this patch
adjusts fff-upgrade.sh to replace the comma from board name
by an underscore for all devices. This should be possible
without harm as OpenWrt images can safely be expected to
either contain a comma in the right place or no comma at all.

It has been discussed whether the same should be applied to
the network.* files as well. However, expecting those to
be removed in the foreseeable future does make this undesirable,
as a lot of code would be inserted now and be removed again a few
months later, only to fix the name for one device.

For the same reason, we won't touch the board name replace
for the TL-WDR4900 v1 for now.

Suggested-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-02 13:07:26 +02:00
Adrian Schmutzler be80e17c57 ar71xx: remove non-existant ubnt-power-m-xw
The ubnt-power-m-xw identifier was introduced in 0447d0c709
("fff-boardname: introduce new ubnt boards") assuming that the
Ubiquiti Powerbeam M2 XW had a separate model identifier in
/var/sysinfo/model (otherwise, it was derived from loco-m-xw image).

However, OpenWrt has never known about a PowerBeam device. Consequently,
on devices nothing changed, and all PowerBeam devices were still
recognized as Nanostation Loco M XW.

Thus, this patch removes all references to a ubnt-power-m-xw, as it's
never been working anyway.

Note that this also implies that any user of a PowerBeam would have
used the wrong antenna_gain values of the Loco M XW by default (and
will continue to do so).

However, actually the Loco M XW has never been tested or supported
officially for this firmware. The image was only used for the
support of the Powerbeam M2 XW in 68314ea943 ("Add support for
Powerbeam M2 XW"). However, since the firmware is expected to work
and seems to be installed on several devices already, we won't remove
the image for now.

For further reference:
The board and model names set in ar71xx are found in the OpenWrt file
target/linux/ar71xx/base-files/lib/ar71xx.sh

Fixes: 0447d0c709 ("fff-boardname: introduce new ubnt boards")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-31 23:35:40 +02:00
Christian Dresel e3df4720f8 fff-webui: show fastd public key in webui
User can see the fastd public key in the webui

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-30 11:57:15 +02:00
Fabian Bläse 3a845b541b Add support for Archer C2600
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-03-30 11:56:17 +02:00
Adrian Schmutzler 4bb31a75f2 show_info: Treat case of missing simple-tc package
Suppress error in show_info when simple-tc is not built into the
firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-22 20:01:12 +01:00
Adrian Schmutzler 93cebbf3f7 packages/fff: Add fff-simple-tc
This new packages is meant to serve as meta-package to store
setup for simple-tc.

This achieves two objectives:
- Increase general maintainability by having relevant code in one
  location.
- Provide the option to include/exclude simple-tc functionality
  just by selecting/deselecting the fff-simple-tc package.

This will allow for easier testing of image size impact of this
functionality, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-22 20:00:55 +01:00
Adrian Schmutzler aa0d237fa9 fff-network: apply upstream swap of MAC addresses for Archer C60
The ethernet MAC addresses of the Archer C60 v1/v2 were swapped
compared to the vendor assignment. This has been fixed in OpenWrt
after 19.07.2.

Apply this to our firmware already, so we cannot forget it later
and prevent having messed-up br-mesh MAC addresses.

The OpenWrt patches can be removed again when bumping to 19.07.3.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:56 +01:00
Adrian Schmutzler aa42a39ce2 fff-network: use static MAC address location for TL-WR1043ND v4
At the moment, the ETHMESHMAC for the TL-WR1043ND v4 is loaded from
the config partition. The data there is written by the stock firmware,
and thus is dependent on the version installed before and may even
vary in position.

Instead, this patch uses the product-info partition, which is not
modified by stock firmware.

While at it, update the sourced library files and the comment for
both v4 and v5.

ref: 53839da46e

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:55 +01:00
Adrian Schmutzler 73e227cdc8 fff-network: account for MAC address change of TL-WDR3600/43x0
In OpenWrt commit 27eea249213b ("ar71xx: fix MAC address setup for
TL-WDR4300 board") the LAN/WAN MAC addresses for the TL-WDR3600,
TL-WDR4300 and TL-WDR4310 were changed.

This creates an overlap of the LAN und 5 GHz MAC addresses, where
the first will also affect the BATMAN interface eth0.3.

To keep BATMAN interfaces with separate addresses, this patch will
set the ETHMESHMAC to eth0 +1, corresponding to the virtual WAN device
(VLAN 2) OpenWrt sets up (which we aren't using anyway).

ref: https://github.com/openwrt/openwrt/commit/27eea249213b04a372491009850926f9282d13

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:54 +01:00
Adrian Schmutzler 7614dc5584 fff-network: account for MAC address change of Archer C7 v2
In OpenWrt commit 8a21bc36229d ("ar71xx: fix MAC addresses for
Archer C5 v1, C7 v1/v2, WDR4900 v2") the WiFi MAC addresses for
the Archer C7 v2 were changed.

This creates an overlap of the LAN und 2.4 GHz MAC addresses, where
the first will also affect the BATMAN interface eth1.3.

To keep BATMAN interfaces with separate addresses, this patch will
set the ETHMESHMAC from eth0, corresponding to the separate WAN
device we are not using in our firmware anyway.

ref: https://github.com/openwrt/openwrt/commit/8a21bc36229d3eabad213ae47fddb4d86d76ac

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:53 +01:00
Fabian Bläse 0c3429f3fb fff-web: Use iw instead of iwinfo for wifiscan
This prepares the fff-web package for removal of the iwinfo binary.

Instead of using the 'iwinfo' wrapper, the nl80211 utility 'iw' is used
from now on, which is possible, because we only support devices with
nl80211 drivers anyway.

Because iw reports the frequency instead of the channel, and does not allow
easily parsing the mode and encryption parameters, the table is adjusted accordingly.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-03-15 22:04:48 +01:00
Fabian Bläse fe6ae924aa fff-hoods: manually create wifi station interface
The mac80211 interface script in OpenWrt depends on wpa_supplicant
for the creation of station interfaces. While this is conveniant, it
isn't strictly necessary for connecting to unencrypted networks.

To be able to create station interfaces if wpa_supplicant is removed,
the station interface for obtaining the initial configuration is now
created using iw commands only.

This makes it possible to replace wpad-mini with hostapd-mini, which
does not include wpa_supplicant and therefore shrinks the uncompressed
binary by around 200KiB.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-03-15 22:04:45 +01:00
Adrian Schmutzler 5ebb60f0ef fff-batman-adv/-server: Remove KMOD for symbols
This follows the changes introduced in
6a25fd5ce5

This is a result of the switch to openwrt-19.07.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[fabian@blaese.de: Rebase onto fff firmware master]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:44 +01:00
Adrian Schmutzler 9f25f5dc35 batman-adv: Split batadv proto in meshif and hardif part
This migrates to the new configuration architecture introduced
and required in
54af5a209e

This is a side-effect of the switch to openwrt-19.07.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[fabian@blaese.de: Rebase onto fff firmware master]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:43 +01:00
Adrian Schmutzler 47de26817b fff-wireless: always disable rssileds if package is installed
This always disables rssileds if the package is installed, and thus
saves us from specifying particular devices.

Since rssileds do not work with our concept of resetting WiFi
interfaces, we cannot use it anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-01-18 19:50:54 +01:00
Christian Dresel 38d2a5a704 fastd: make secret key update-safe
To use a whitelist easily, it is necessary to make the fastd key
update-safe.
This patch saves the key to uci fff config and recovers it for
use after a firmware upgrade.

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: lemmi <lemmi@nerd2nerd.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[bump PKG_RELEASE, rephrase commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-01-10 14:31:58 +01:00
Adrian Schmutzler 1c014d04f4 fff-boardname: start uci-defaults script early
The WiFi configuration scripts have been moved to an earlier point
in initialization sequence in c39de8f7d5 ("fff-wireless: initialize
WiFi config before setting up wXsta"), which has them run before
the script setting board name in uci config files. Since the script
setting manual antenna gain and fixing rssileds depends on having a
board name, though, the move broke this functionality.

Since the board name set up script itself does not depend on anything
else in the uci-defaults scripts, let's move this one to a relatively
early point in initialization (and save us from touching anything
else).

Fixes: c39de8f7d5 ("fff-wireless: initialize WiFi config before setting up wXsta")
Fixes: #135

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-01-04 13:46:23 +01:00
Christian Dresel 08c210a309 gateway.d: use correct function name for apply hook
The configuregateway script calls only "apply" and not "commit".

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
[commit title and message facelift, bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-12-30 15:18:14 +01:00
Fabian Bläse 99bce95f80 fff-wireless: Use previous HT/VHT mode instead of detecting capabilities
Previously the HT/VHT mode was detected using the output of iw phy. This
command erroneously used the $radio variable, which doesn't contain the
phy name. Therefore it doesn't work like it is supposed to.

As we don't completely configure the wifi-device sections, but only adjust
some of OpenWRTs default values, the HT/VHT detection can easily be done by
just checking if the previous mode did contain "VHT".

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-24 12:52:05 +01:00
Adrian Schmutzler 6a43b7dfdb fff-sysupgrade: move /etc/sysupgrade.sh to /sbin/fff-upgrade.sh
The old name "sysupgrade.sh" is easy to be confused with OpenWrt's
/sbin/sysupgrade. Rename our script to clearly indicate its
purpose.

While at it, move from /etc to /sbin, as the former is an odd location
for an executable script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-12-14 12:08:03 +01:00
Fabian Bläse 30c7541e6f fff-network: Add portorder to Archer C7v2
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-10 10:02:26 +01:00
Fabian Bläse 8d66bdf35c fff-network: Only use one Switch Port on Archer C7v2
Previously the TP-Link Archer C7v2 was configured to use
two Switch CPU Interfaces. One for Trunk (Client + Batman), one
for WAN.

As this setup is very uncommon in our firmware at the moment and does interfere
with the automatic CPU Port setup in layer3 variant, it is converted to a single
trunk port setup just like all of the other routers with integrated managed switches.

As eth0 is now used as the switchport, this change would require to setup
a different ETHMESHMAC if mac addresses would be shared between interfaces.

The device does seems to have 4 discrete mac addresses however, so the
explicit ETHMESHMAC setting is completely removed instead.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-10 10:02:06 +01:00
Fabian Bläse d718d0faa9 fff-wireless: Set htmode to VHT for 802.11ac capable radios
To make use of MCS 8 and 9 which have been introduced with
802.11ac, htmode has to be set to VHTxx.

By checking if the radio supports it, the htmode is configured
to the appropriate HT/VHT setting.

Fixes: #130
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-10 10:01:39 +01:00
Adrian Schmutzler c39de8f7d5 fff-wireless: initialize WiFi config before setting up wXsta
The script for setting up wXsta (/etc/uci-defaults/24c-fff-wXsta) runs
before the main WiFi config script (/etc/uci-defaults/60-fff-wireless),
so the wXsta config is deleted again by

config_foreach removeWifiIface wifi-iface

This moves the latter script (and another script for WiFi config)
before the wXsta setup, so the WiFi config will be set up correctly.

Fixes: #128
Fixes: 3d9eb1db2e ("fff-hoods/fff-wireless: Reconfigure instead of
delete and create")
Reported-by: Christian Dresel <fff@chrisi01.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-30 20:07:23 +01:00
Fabian Bläse 141f48389d fff-wireless: Hide errors if device doesn't have radios
Some output and exit status are hidden, as they are a valid behaviour
if the device doesn't have any radios.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-23 21:59:39 +01:00
Fabian Bläse d968665704 fff-hoodutils: Add fallback for upgrade path
If no hoodfile is present or hoodfile support is not compiled
into the firmware, no upgrade path is available. This currently
is the case for layer3 variant.

A fallback to our default firmware host is added. At the moment
both variants don't have a trust anchor for TLS and the wget, that
is currently used, doesn't support TLS. Therefore it is currently
necessary to use a unencrypted http URL.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-23 14:29:15 +01:00
Fabian Bläse be04d36784 fff-hoodutils: Adjust upgrade path function for changed folder structure
As we now have multiple variants, the binaries on the update server
should be seperated into different directories.

To allow the firmware to decide which variant it wants to download,
the "$VARIANT/current" part is removed from the hoodfiles. Instead
it is added inside the upgrade path function in fff-hoodutils.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-23 14:29:06 +01:00
Fabian Bläse 3e1f6e167d Remove target and subtarget from filename
This simplifies and shortens filenames quite significantly.

A rewrite script will be installed on the update servers
to allow updating routers with older firmwares.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-20 20:05:03 +01:00
Fabian Bläse 87f6f9969f fff-web: Do not remove uploaded binary on sysupgrade failure
For some reason sysupgrade seems to return exit status != 0
even on successful calls. As the binary is removed if
sysupgrade exists with a failure status, it is possible that
it got deleted while a sysupgrade has been in progress.

This removal was added to ensure that only one binary occupies
space in tmpfs (which is stored in memory) when upgrading.
If sysupgrade fails and the user starts another try, the old
binary is overwritten by moving the new one to the same location.

Therefore the removal of binaries on sysupgrade failure can be
removed completely.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-11-20 20:01:33 +01:00
Adrian Schmutzler 1a835f664c fff-wireless: improve treatment of dysfunctional rssileds
The rssileds set up by OpenWrt cannot be used in our firmware.
Despite that those are bound to "wlan0" initially, we also cannot
change them to one of our interfaces, as the interface recreation
due to configurehood seems to break something in rssileds, causing
high load.

This patch now disables the rssileds entirely, which has been found
to be the only solution reliably solving the problem of high load
under all circumstances.

While at it, add all remaining devices with rssileds enabled in
openwrt-18.06. (When updating to openwrt-19.07, most of the ubnt
will have to be added.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-19 22:27:56 +01:00
Adrian Schmutzler 329ed31cde fff-wireless: merge WiFi adjustments into one simple script
This merges the wifi.* files into a single script, which improves
overview/manageability and makes merging of cases possible.

While at it, remove suppression of errors with "-q".

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-19 22:27:21 +01:00
Adrian Schmutzler 1e963f5f39 Add support for Archer C60 v2
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-19 22:21:42 +01:00
Adrian Schmutzler 2b77353685 packages/fff: Merge meta packages for variants into config packages
So far, we have meta packages and config packages for the variants
in parallel, e.g. fff-node and fff-variant-node.

Since the sole purpose of the meta packages is to define
dependencies, one can just merge them into the corresponding config
packages to reduce overhead.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-17 15:48:50 +01:00
Adrian Schmutzler 6f132f858e firewall.d: Check for unset IF_WAN
In some cases (mostly for one-port devices) IF_WAN was used
although not set, resulting in not obviously iptables error
messages like

- Bad argument `conntrack'

- Bad argument `REJECT'

Thus, check whether IF_WAN is set to something before using it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-11-17 15:46:34 +01:00
Adrian Schmutzler 40cad0a9b9 treewide: Force use of busybox wget
In OpenWrt commit 055cdab2bb22 ("uclient: add ALTERNATIVES for wget")
uclient is registered as ALTERNATIVES provider for wget. Since
the priority for busybox as provider is lowest, this overwrites
the link set for /usr/bin/wget, now pointing to uclient wget.

However, uclient wget does not support IPv6 link-local addresses,
as it's not aware of the "%" to separate address from link identifier.

To prevent wget from failing when those addresses are used, this
patch explicitly uses busybox wget.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-17 15:45:24 +01:00
Fabian Bläse 6724aaedee Move node-specific firewall rules to fff-node
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-10 14:27:46 +01:00
Fabian Bläse ccfde6c655 fff-network: Remove dependency to uradvd
As odhcpd is used as router advertisement server in layer3 variant,
but configurenetwork is still necessary, the dependency to fff-uradvd has
to be removed.

This is done by first checking, if the fff-uradvd service exists, before it
is restarted.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-11-10 14:22:56 +01:00
Fabian Bläse 3f86bfc70a fff-wireless: Add gateway configuration scripts
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-11-10 14:22:29 +01:00
Fabian Bläse 03d94d92fd nodewatcher: Add support for babel neighbours
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-10-21 13:53:32 +02:00
Robert Langhammer d989f435e6 fff-network: Have WAN sysctl commands executing after global ones
On layer3 variant ("gateway firmware"), 60-fff-gateway.conf
changes "forwarding" for all interfaces, overwriting the
changes from 51-fff-network-$iface.conf.

By putting the WAN-specific commands after 60-fff-gateway.conf
this patch should provide the correct device-specific value
for WAN interface now.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Rephrased commit title and added message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-10-07 16:20:35 +02:00
Fabian Bläse cac9b55aa2 nodewatcher: Send babeld version
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-10-07 14:44:10 +02:00
Fabian Bläse 199058d110 babeld: Automatically add redistribute filters
babeld filters routes before announcing them with the
redistribute filters.

Users might add unknown public subnets to the client interface,
so redistribute filters have to be generated for these addresses.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
2019-09-30 10:38:16 +02:00
Fabian Bläse c3f8b808ec fff-gateway: Add sanity checks
This adds two checks:
- Does gateway config exist?
- Does gateway config version match?

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:29:25 +02:00
Fabian Bläse 40e1577a50 configuregateway: Print newlines for improved readabilty
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:27:07 +02:00
Fabian Bläse 6fdc930301 Add support for Ubiquiti EdgeRouter X (SFP)
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-09-29 21:18:11 +02:00
Fabian Bläse d8ea5c652f fff-gateway: Add firewall rules to ensure nothing is forwarded onto WAN
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:14:17 +02:00
Fabian Bläse 6c706432a6 Create fff-node package
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:13:54 +02:00
Fabian Bläse d7737beb8c Rename variant meta-packages to avoid confilcts
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:13:20 +02:00
Adrian Schmutzler 004b386d55 nodewatcher: Remove leftover use of batman-adv sysfs
In d9ec8edb15 ("batman-adv: Move from DEBUGFS to batctl") we
switched from deprecated DEBUGFS to batctl.

Despite debugfs, batctl seems to also have deprecated sysfs
(https://www.open-mesh.org/news/90).

This patch thus replaces a reference to iface_status by the
corresponding batctl command.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-21 18:16:09 +02:00
Alexander Gutzeit ca40d2d766 fff-wireguard: rename keys to remote_public_key/local_private_key
This renames two options for wireguard interfaces in
/etc/config/gateway:
public_key -> remote_public_key
private_key -> local_private_key

Signed-off-by: Alexander Gutzeit <alexander.gutzeit@web.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
[adjusted commit message/title, added version bump, remove
rename for network config]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-08-21 18:14:30 +02:00
Robert Langhammer 854ba40568 package/fff: add ip-full to variant layer3
"ip" is one of the most essential tools on a gateway. At the moment
there is only one dependency to the metapackage ip from the nodewatcher,
which pulls ip-tiny. Dropping the nodewatcher causes a fallback to the
busybox built-in ip-command.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[fabian@blaese.de: rebase onto master]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2019-08-14 00:38:29 +02:00
Fabian Bläse 2978cbeb4e Add fff-wireguard package
This package adds gateway.d scripts which create
peering interfaces using wireguard.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-14 00:33:07 +02:00
Fabian Bläse 104a260843 fff-babeld: Add prefix to configuration name
When the user removes a peer from /etc/config/gateway,
the script has to be able to find any leftover configurations
that have been created for it.

This can be made very easy by prepending a prefix to every
automatically generated configuration.

This also allows to remove the nasty check for the babeld default interface.
Therefore the naming check for cfg* also can be removed.

As a side effect all manually created configuration blocks that do not match a
prefix will not be touched by configuregateway.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-14 00:32:44 +02:00
Fabian Bläse 53ff6f631b fff-babeld: Move common babeld procedures into functions
Various things have to be done for every interface on
which babeld shall run.

Those procedures are moved into functions to reduce duplicate code.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-14 00:32:18 +02:00
Adrian Schmutzler fbc7dab6de fff-support: Add device name and firmware version to MOTD
This adds a line containing the device name and the current
firmware version to the MOTD shown after logging in via SSH, e.g.

> TP-Link TL-WR1043N/ND v2 @ jubtl9_20190320

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-22 22:47:51 +02:00
Adrian Schmutzler 4d5731341b configurehood: Do not suppress uci errors where not necessary
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-22 22:36:38 +02:00
Adrian Schmutzler 3d9eb1db2e fff-hoods/fff-wireless: Reconfigure instead of delete and create
Previously, when configurehood switched status, all WiFi devices
were completely rewritten and all interfaces were deleted and
recreated. This is both unnecessary and ugly.

This patch redesigns WiFi setup to create all interfaces (in
parallel) initially, and then only to enable/disable them as
necessary. Where reconfiguration is necessary, only the variable
parts are changed.

Since most of the wifi-device config is already created by
OpenWrt, this builds based on the existing wifi-devices and
only removes the default wifi-ifaces.

This patch will not change the logic (codeflow) of configurehood,
but only affects how action on the WiFi devices/interfaces is
taken.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-22 22:34:56 +02:00
Adrian Schmutzler 8a1eb6d4c8 fff-wireless: Also use wXmesh label for wXibss
The two different names "wXmesh" and "wXibss" have no functional
purpose and are just for indication. Remove this distinction, so
mesh is just mesh.

This will make further adjustment easier and clearer.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-22 22:33:33 +02:00
Adrian Schmutzler 99d7a95d04 fff-tunneldigger/tunneldigger: Remove packages
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:59:58 +02:00
Adrian Schmutzler b38578aded show_info: Remove L2TP diagnostics
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:59:12 +02:00
Robert Langhammer 5a119dcda8 fff-nodewatcher: remove l2tp
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Bump PKG_RELEASE and SCRIPT_VERSION]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:58:57 +02:00
Robert Langhammer cc59852570 fff-web: remove l2tp
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:58:48 +02:00
Robert Langhammer 4941d6eff5 fff-vpn-select: remove tunneldigger
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Rebased, updated PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:58:13 +02:00
Adrian Schmutzler 0889cf35d8 packages/fff: Tidy up wget dependencies
The symbols BUSYBOX_CONFIG_WGET and
BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT are set in different
packages and do not correlate with where Busybox wget is
actually used.

This updates packages dependencies based on the current
situation.

Note that with current firmware, both two versions of wget
are installed:
/bin/wget
/usr/bin/wget

The latter is from busybox and is used as the default version.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-01 23:04:21 +02:00
Adrian Schmutzler e9268539d1 packages/fff: Only use PKG_RELEASE for our own packages
PKG_VERSION is meant to refer to the version of external packages,
as we do e.g. in the tunneldigger package.

For our own packages, we just need the PKG_RELEASE variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[Rebased onto current state of master]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-07-01 21:54:09 +02:00
Adrian Schmutzler 26b3a13b7c alfred-json: Set PKG_VERSION to latest official version
Although this tag is very old, this is how PKG_VERSION is meant
to be used.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-01 21:37:23 +02:00
Fabian Bläse 3b746e022e Add support for TP-Link Archer C7 v5
Signed-off-by: Fabian Bläse <fabian@blaese.de>
[freifunk@adrianschmutzler.de: Added Portorder]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-06-22 21:55:17 +02:00
Fabian Bläse 2f359a3e00 fff-babel: add configuration scripts
This adds a configuration script to allow configuration
of babel with configuregateway.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2019-06-22 21:25:18 +02:00
Adrian Schmutzler 06bf24f639 fff-batman-adv-legacy: Remove unused package
This hasn't been used since it was replaced. Remove it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-06-15 12:46:50 +02:00
Fabian Bläse 275c4b255c fff-dhcp: Add configuration scripts for dns
Because DNS Forwarding is done by dnsmasq which we configure
inside the fff-dhcp package, the configuration scripts for dns
are placed in this package.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-06-15 12:45:28 +02:00
Adrian Schmutzler 02fae91477 fff-macnock: Add dependency from tc
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-06-15 12:32:22 +02:00
Fabian Bläse 29d5a10153 gateway.d: Remove output from meta script
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:17:18 +02:00
Fabian Bläse 656102999a packages/fff: Only use fff-batman-adv for node-variant
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:16:47 +02:00
Fabian Bläse 07b6a6eb3a packages/fff: layer3-variant: Add useful debugging tools
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:16:37 +02:00
Fabian Bläse 4fb9c4c652 fff-sysupgrade: Add gateway config to sysupgrade.conf
User configuration for layer3 firmware is stored in
/etc/config/gateway. To preserve this file across updates it
is added to sysupgrade.conf

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:16:23 +02:00
Fabian Bläse b652825b7a packages/fff: Use fff-gateway package when compiling layer3 firmware
fff-gateway is mandatory when compiling layer3 firmware.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:16:18 +02:00
Adrian Schmutzler 1fef2e4117 fff-wireless: Raise MTU for 802.11s mesh to 1560
This will prevent batman-adv packet fragmentation on 802.11s mesh.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 17:23:32 +02:00
Adrian Schmutzler fe9c5919e6 fff-network: Remove MTU 1528 from ethmesh device
This interface was using 1500 anyway and setting ethernet to
MTU > 1500 might not be a good idea.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langammer <rlanghammer@web.de>
2019-05-31 17:22:52 +02:00
Adrian Schmutzler 9c5b65a770 configuregateway: Only match "function" in subshell
When running OpenWrt master, "type <functionname>" only returns
"<functionname> is a function". Thus, to make the implementation
future-proof and since it is also working with the current state,
change the grep in execute_subshell to match "function".

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 17:21:10 +02:00
Adrian Schmutzler dbd8607b53 upgrade.html: Rename uploaded firmware before sysupgrade
At the moment sysupgrade via WebUI is broken on many devices.
This is reproducible: While the (few) status messages seem
normal, the device boots again with the old firmware.
Sysupgrade via SSH always works.

The sysupgrade call in upgrade.html directly uses the path of
the uploaded firmware file as argument. From several tests and
based on caught stdout/stderr from this line, it looks like haserl
deletes the uploaded firmware file due to a hidden trigger before
or even while it is processed by sysupgrade.

The easiest way to work around that is to just rename the file
before using it as argument to sysupgrade. This will preserve the
file DURING sysupgrade. If sysupgrade fails explicitly (status
code != 0), remove the file to provide sufficient memory for
another upload.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 17:18:18 +02:00
Fabian Bläse 590dbca7a9 gateway.d: Add scripts for network configuration
This adds scripts to configure vlan and client network.
This also adds sysctl settings to enable forwarding.

Note:
Devices specific properties are sourced from fff-network package.
This creates a dependency on fff-boardname and fff-network.
These properties should be located elsewhere in the future.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-25 19:26:00 +02:00
Adrian Schmutzler 555e91628b fff-network: Provide script with CPUPORT
This provides the CPUPORT which is needed for the gateway firmware.
The script is supposed to be sourced.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-05-25 19:22:49 +02:00
Fabian Bläse d687823a27 gateway.d: Add configuration script for meta information
This adds a configuration script for applying hostname,
coordinates, hoodname and contact address.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-05-09 11:03:32 +02:00
Fabian Bläse b40c45b69c fff-gateway: add package
This introduces a new script for simple gateway configuration.

The main configuregateway script is able to execute functions
for various steps like 'configure' or 'apply' from scripts in /etc/gateway.d.

This makes it easy to distribute configuration to the appropriate packages.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-05-09 11:03:13 +02:00
Adrian Schmutzler d9371a7a22 configurehood: Leverage -H option for batctl
Since batctl can suppress headers, we do not have to count lines.

Cosmetical change.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-04-15 15:54:41 +02:00
Adrian Schmutzler 518c0d6fef fff-sysupgrade/fff-web: Free cache before upgrade
This might reduce the chance to break devices with 32 MB RAM
during sysupgrade.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-04-15 15:54:18 +02:00
Adrian Schmutzler d9ec8edb15 batman-adv: Move from DEBUGFS to batctl
The debug filesystem will be deprecated and disabled by default
in newer versions of B.A.T.M.A.N.

This patch switches our code to the batctl, as recommended.

Since batctl can suppress headers, this actually makes our life
easier ...

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-03-27 18:24:29 +01:00
Adrian Schmutzler 95a22327fe fff-base: Fix another indent
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-02-10 22:45:46 +01:00
Adrian Schmutzler d0d8fc57af configurenetwork: Tidy-up auto configuration functions
This fixes a typo in description and introduces a single variable
for the sysctlfile.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-02-10 22:44:26 +01:00
Adrian Schmutzler e34f5b0119 build: Remove "squashfs" from image names
This is just meant to make image names shorter.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-02-10 22:44:06 +01:00
Adrian Schmutzler e6c469ec3c tunneldigger: Fix indentation for conffile in Makefile
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-02-05 14:29:31 +01:00
Adrian Schmutzler fa2ead9306 packages/fff: Use tabs in Makefiles
Currently, Makefile use a mixture of tabs and spaces with various
indents. This harmonizes all Makefiles to use tab indentation only.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-02-05 14:29:31 +01:00
Adrian Schmutzler 3db6e99928 fff-base: Do not manually select fff-vpn-select
Since we went on to the KeyXchangeV2, fff-vpn-select is a pure
subpackage/utility of fff-hoods. Thus, we should not manually
select it, but have it selected indirectly by fff-hoods.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-02-05 14:29:31 +01:00
Tim Niemeyer f0eae4fff4 buildscript: support to choose the build variant
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-02-05 14:29:31 +01:00
Tim Niemeyer 5074c6b08f packages/fff: add layer3 variant
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-02-05 14:29:20 +01:00
Tim Niemeyer 609269f3a4 alfred-json: compile fix
This fixes:
Makefile:27: *** missing separator.  Stop.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-02-03 03:05:52 +01:00
Fabian Bläse 2fdebf6c93 sysctl: Enable tcp timestamps for improved tcp performance
tcp timestamps can improve tcp performance a lot, especially
with unstable networks like wifi.

Linux default behaviour is enabled so the tcp timestamps setting
is removed from sysctl configuration.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-01-31 19:29:33 +01:00
Fabian Bläse 30818f0ab1 packages/fff: Add fff-ra package
This Package adds a router advertisement daemon and
appropriate Freifunk Franken specific configuration for it.

The ra_default option is set to '2' to force the default flag,
even if no default route for ipv6 is present.
This is necessary, because otherwise fc00::/7 targets would be
unreachable, since odhcpd is unable to send specific routes inside a RA.
This won't affect clients ability to reach hosts which have a dual stack
connection, typical network stacks prefer IPv4 over IPv6 ULA when no
public IPv6 address is available.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-01-29 22:25:27 +01:00
Fabian Bläse 24925dee3b fff-dhcp: Remove incorrectly placed RA configuration
Configuration of Router Advertisements is done in a seperate package.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-01-29 22:25:11 +01:00
Adrian Schmutzler 3ab75a084b Add support for TP-Link CPE210 v3
This device is still in PR state in OpenWrt, since ar71xx target
is deprecated and thus lacking reviewers.
It worked nicely for me anyway, so I include the current state of
the PR (has not changed for months).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-01-29 22:24:17 +01:00
Adrian Schmutzler 8f322c253a Add support for TP-Link CPE210 v2
With our dynamic resetting of WiFi interfaces, the rssileds
of OpenWrt do not work correctly. This disables them as a
workaround, since they otherwise create about 20 % CPU load.

Since the MACH file for all CPE210/510 is the same, no adjustment
of the OpenWrt-tiny patch is needed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-01-29 22:23:46 +01:00
Adrian Schmutzler d0d6f5335f Add support for Archer C60 v1
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-01-29 00:57:33 +01:00
Adrian Schmutzler 428304da07 (fff-)alfred: Add dependency in monitoring-proxy and alfred-json
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-01-29 00:56:35 +01:00
Adrian Schmutzler b969eff22c fff-alfred-monitoring-proxy: Remove dependency from nodewatcher
The proxy only sends data from alfred master to the Monitoring.
It does not require the device to produce alfred-data in the
nodewatcher itself.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-01-29 00:52:31 +01:00
Adrian Schmutzler dc6d77610f wget: Remove -t from calls
The wget from busybox we are using ignores the -t option,
although it does not throw errors in the currently used version.

However, specifying the -t option in calls where it is not used
is misleading, so it should be removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-01-29 00:50:32 +01:00
Tim Niemeyer 23a81ffb9a packages/fff: add new fff-babeld package
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Signed-off-by: Fabian Bläse <fabian@blaese.de>
- Convert configuration to uci
- Split IPv4 network rules to fff specific subnets
- Add IPv6 ULA network rules
- Change PKG_VERSION to single number versioning
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
- Removed "delete batman-adv.bat0"

Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-01-28 13:10:40 +01:00
Adrian Schmutzler 0a63717ab1 alfred-monitoring-proxy: Improve curl call
This improves the curl call by:
- Using full executable path
- Removing redundant -X POST
- Using --data-binary instead of --data

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-01-27 22:50:15 +01:00
Adrian Schmutzler 4d55ef39f3 alfred-monitoring-proxy: Switch to alfred2
By using the alfred2 mechanism of the Monitoring, we get rid
of the embracing {"64":...} key-value construct.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-01-27 22:50:04 +01:00
Adrian Schmutzler 7e8ac80dee alfred-json: Remove inapplicable lines from Makefile
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-01-27 22:48:09 +01:00
Adrian Schmutzler 518dc56145 packages: Harmonize indent
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-01-27 22:46:50 +01:00
Steffen Pankratz 9b5d3f1aeb fff-alfred-monitoring-proxy: add package
CC: kratz00@gmx.de
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
- Changed subject
- Changed curl parameters
- Added firewall rule
- Configure alfred to be master
- Add fff-nodewatcher as dep, because we use the alfred config
- Change data handling during curl to pipe
- Add newline on cron rule
Signed-off-by: Fabian Bläse <fabian@blaese.de>
- Fix alfred master mode introduced by packaging alfred
- Adjust monitoring-proxy waittime to suggestion
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-01-27 15:38:38 +01:00
Steffen Pankratz 3206c0c1c7 packages/alfred-json: added package
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
- Changed subject
- Move alfred-json to own repo
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Robert Langhammer <rlanghammer@web.de>
2019-01-27 15:38:38 +01:00
Tim Niemeyer f40ff9468f packages/fff: add new fff-dhcp package
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Signed-off-by: Fabian Bläse <fabian@blaese.de>
- configure router advertisements
- fix package title
- remove unnecessary dhcp config on first boot
- lower lease time
- only commit dhcp uci section
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-01-19 22:50:38 +01:00
Christian Dresel f8269102a5 fff-hoods: firewall fe80::1 from Client to Batman and Node
This firewall blocks all communication with fe80::1 from a
Client to Batman and to the Node.

We need this because some crap devices (e.g. a wrongly
connected router on a clientport) have fe80::1 as address
and break our setup.

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-12-09 14:31:09 +01:00
Fabian Bläse cb0420e2d3 configurehood: Don't offer hoodfile when using local hoodfile
When using local hoodfile neither this nor central hoodfile
downloaded earlier should be offered to neighbours, so remove it
from the webroot.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2018-12-09 14:29:00 +01:00
Fabian Bläse 1da800bfce configurehood: Copy local hoodfile to common location
Instead of overwriting local variable to local hoodfile location,
copy it to the commonly used location. This makes the local hoodfile
behave exactly like central hoodfiles, which prevents some border cases.

The previous behaviour mainly caused issues when using getJsonPath() and
getUpgradePath() from fff-hoodutils.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2018-12-09 14:28:08 +01:00
Christian Dresel 9999b7b2cb fff-sysupgrade: merge SOC and SUBTARGET
This make it easier to use new targets without subtarget.

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-12-09 14:27:30 +01:00
Adrian Schmutzler 83a70ed5a9 fff-batman-adv: Enable bridge loop avoidance (BLA)
Based on the documentation, BLA will only help if two nodes
are connected via WiFi AND via Ethernet cable on CLIENT ports!
For a "correct" setup, e.g. WiFi and BATMAN port connection,
BLA won't have an effect.

Since the former case is possible and there are no known
drawbacks, we enable BLA.

This removes the line to disable BLA, so it will be enabled as
B.A.T.M.A.N. enables it by default.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-12-05 19:30:03 +01:00
Adrian Schmutzler 433b9e4510 show_info: Add VPN peer lists for fastd/L2TP
This shows the configured peers for fastd and L2TP.
Note that "configured" does not tell whether they are working.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2018-12-05 19:29:46 +01:00
Adrian Schmutzler 9576ee7786 show_info: Add hoodid
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2018-12-05 19:29:29 +01:00
Fabian Bläse b66f04012b Disable 802.11b rates using OpenWRT option
Instead of manually overwriting basic and supported rates,
this patch makes use of a new OpenWRT option "legacy_rates",
which disables 802.11b data rates.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-11-27 23:35:15 +01:00
Adrian Schmutzler ef00054916 configurehood/nodewatcher: Also process hood ID in addition to name
So far, the Monitoring evaluates hoods based on their names.

This introduces several problems, most prominently a hood
re-creation if it is renamed at the KeyXchange.

Since we have unique hood IDs in the KeyXchange and the
Monitoring retrieves those via hoods.php, it is logical use this
information instead of relying on string comparison.

This requires the hood files to contain an additional field "id".
While this has not been implemented, the changes in this patch
will still work and just write empty data to the uci field and
alfred data.

For local hoods, the "id" in the hood file will remain unset.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-11-27 23:20:13 +01:00
Fabian Bläse 665377ab68 network: set router solicitations to default value
When setting up a node, router solicitations can be used to speed
up receiving router advertisements a lot. This mechanism has been
previously disabled by our custom sysctl config.

However because linux does not send router solicitations, if it
doesn't accept router advertisements, which is disabled for every
link except WAN, this option can safely be set to it's default value
for all interfaces.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-11-27 23:19:42 +01:00
Adrian Schmutzler 0a05b15d43 nodewatcher: Change default name to be replaced back to OpenWrt
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-11-21 15:31:42 +01:00
Adrian Schmutzler a37dedda26 Always send hood to Monitoring
Since the MacNocker was introduced, the hood information in
UCI is DELETED if the hood is lost.

If the router still successfully sends alfred data in this state,
the Monitoring will treat it as a V1 device. This is annoying,
especially since it looks like a loop.

An easy solution is to send an empty <hood> field in those cases,
as V2 routers are detected by them knowing their hood.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-11-21 15:31:15 +01:00
Robert Langhammer eed0705407 Remove batman option no_rebroadcast
This sysfs option no longer exists.

The no_rebroadcast option was used as part of gluon’s
batman-adv-legacy implementation, after open-mesh decided
to not include it into batman-adv v14:

https://patchwork.open-mesh.org/patch/3434/

Our firmware has included (and enabled) it since December 2013.

With the upgrade to batman-adv v15 (pulled from openwrt-routing
then) in October 2017, the custom patch was no longer included.
It looks like open-mesh provides an equivalent built-in
solution now:

https://git.open-mesh.org/batman-adv.git/commit/a00797d8fa8fd1471e8be1ac23d506f76d866aaa

Thus, the option can be removed.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-11-12 11:47:58 +01:00
Fabian Bläse 672e7a2f9b fastd: Allow IPv6 remotes for peers
The "ipv4" option is used to enforce using ipv4 when
using dns for fastd remotes.
However this option was incorrectly always set which
makes ipv6 connections impossible.
Because enforcing ipv4 is not necessary, this option
is removed.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Tested-by: Fabian Bläse <fabian@blaese.de>
2018-11-12 11:47:07 +01:00
Adrian Schmutzler e1b9280f12 nodewatcher: Prevent multiple instances at the same time
This is based on the configurehood-Patch from Tim Niemeyer.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-11-07 15:29:00 +01:00
Adrian Schmutzler e5d3335c72 configurehood: Prevent multiple instances at the same time
This is based on a similar patch from Tim Niemeyer.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-11-07 15:28:36 +01:00
Adrian Schmutzler 2f7e8a18d8 configurehood: Introduce random delays to dilute requests
Instead of having 1000 routers accessing the KeyXchange in the
same second, this will dilute the request within a period of
15 seconds.

Same is done for queries from gateways.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-10-31 17:37:47 +01:00
Adrian Schmutzler 14622e20c2 fff-network: Make CLIENT default status for one-/two-port devices
The V2 firmware requires initialization of the WiFi interfaces
by a hood file. If a one-port (or two-port) device is isolated,
it won't get this information from other WiFi nodes (w2sta mode).

In addition, it cannot be connected to the internet, as this would
require the port to be in WAN mode. It is also not possible to
connect a client device for configuration, since WiFi is not
configured and the LAN port is in BATMAN mode.

To enable configuration of an isolated one-port/two-port device,
this patch thus changes the default port config to CLIENT, so
the user can choose the desired configuration more easily.

For two-port, we will have one port WAN and the second port
CLIENT.

Fixes #110

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Harald Thuemmler <int@bnhof.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-10-25 16:34:59 +02:00
Adrian Schmutzler 3856fff4be fff-sysupgrade: Fix comparison for version in sysupgrade.sh
The previous version seemed to work only for numeric data.

Fixes #113

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-10-25 16:34:20 +02:00
Adrian Schmutzler dc4746eae9 fff-hoods: Do not run configurehood and nodewatcher at the same time
nodewatcher and configurehood have both been run with */5 in micrond.

This may lead to nodewatcher accessing information just being
changed by configurehood. To prevent this, we just change the
start of configurehood, as this has no known disadvantages.

A change of the nodewatcher start would also solve the problem,
but nodewatcher is synchronized to the alfred-master and the
Monitoring.

Fixes #96.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-10-25 16:33:47 +02:00
Tim Niemeyer dc18e22a29 fff-sysupgrade: Update sysupgrade.sh to support openwrt-18.06
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[Set PKG_RELEASE back to 1]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-10-24 18:33:41 +02:00
Adrian Schmutzler f6a457fd5e fff-firewall: Fix match in ip6tables and add dependencies
The syntax " -m state --state " seems to be not supported anymore.

The replace should not change behavior compared to
lede-17.01-based firmware.

Added required dependency.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-10-24 18:04:52 +02:00
Adrian Schmutzler aaccc17496 fff-boardname: Fix changed board name of WDR4900v1
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-10-24 18:04:38 +02:00
Robert Langhammer 18e4263c6a Remove unusual shebang in files to be sourced.
Fixes: #101

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-09-17 12:38:38 +02:00
Adrian Schmutzler 1e5f4f1319 fff-wireless: Provide device-specific WiFi settings and set TX power
Like the network.* files, this introduces wifi.* files to set
device-specific settings.

In contrast to the former, the wifi.* settings are only run during
firstboot and only if there is a file present.

In this patch, we set the antenna gain values for the devices not
treated correctly in OpenWRT.

Side conditions:
- The script requires 50-fff-boardname and 60-fff-wireless
  beforehand, so I chose 62 as number.
- The wifi command is not necessary, since after firstboot
  configurehood will run "wifi" in any case

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
- Changed to base on the ubnt board names
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-09-17 12:38:10 +02:00
Tim Niemeyer 0447d0c709 fff-boardname: introduce new ubnt boards
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-09-17 12:38:03 +02:00
Tim Niemeyer decd4ed402 fff-hoods: add dependency to fff-vpn-select
The vpn-select is used by fff-hoods.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-08-11 15:48:42 +02:00
Tim Niemeyer 21dcd57a16 fff-sysupgrade: move config migration to fff-config
Seems like the /etc/config/fff is owned by fff-config.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-08-11 15:48:42 +02:00
Tim Niemeyer c1fc513cef buildscript: remove community config
The community file is not used anymore.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-08-06 15:31:32 +02:00
Adrian Schmutzler 53184f63fb vpn-select: Demand hood file to be provided as argument
By removing the reference to the hood file from vpn-select, we
remove the entire dependency from fff-hoodutils.
vpn-select will now work with any file provided, as long as
it has the correct syntax. At the moment, the only provider
is the configurehood script. Since the various hood file variants
are handled there, it seems logical that configurehood also
chooses and provides the correct hood file for vpn-select, instead
of vpn-select which had no other contact with hood file choice.

This is simple, tidy and effective.

Adjusted some comments.

Fixes #106

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-08-02 18:59:11 +02:00
Robert Langhammer 62fd2b71e0 Remove double square bracket. [[ is a bash or ksh built-in, and cannot be used in a #!/bin/sh script.
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-07-26 21:57:57 +02:00
Robert Langhammer 37c634ba7c Remove double equals.
== is a bash specific alias for = , and
should not be used in #!/bin/sh scripts. Not in #!/usr/bin/haserl scripts
either, where the shell defaults to /bin/sh.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
- rebased
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2018-07-26 21:57:34 +02:00
Adrian Schmutzler 348cdbe8d3 nodewatcher: Change mechanism for client device detection
This is simpler than the previous approach and does not rely
on parsing.

This fixes:
- Interfaces being accounted for multiple times for certain
  devices
- Errors when output of bridge function changes (as with the
  current OpenWrt master)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-07-26 09:22:32 +02:00
Adrian Schmutzler f986d59080 configurehood: Don't remove timestamp for checksum comparison
Timestamps in hood file currently only change if changes are
made. Thus, there is no reason to remove them for comparison.

This also fixes the wrong quote characters in the script, which
changed the script in a way the timestamps aren't removed right
now anyway.

After this change, a hood reconfiguration may be triggered by
just changing the timestamp at the keyxchange.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-07-25 23:00:40 +02:00
Adrian Schmutzler 4a266c8301 hood files: Move files from /www to /tmp and link there
With this patch, changing the hood file happens in
memory, so we do not have to write on flash "frequently".

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-07-25 23:00:27 +02:00
Adrian Schmutzler 9351f226ba configurehood: Only provide hood file from GW/KeyXchange via WWW
This will copy to hoodfilewww every 5 minutes!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-07-25 23:00:12 +02:00
Adrian Schmutzler d0ef635bd4 hood file: Use different files for www and for checksum comparison
At the moment, we use the same file for detecting changes in a
new hood file and for broadcasting the hood information to be used
by mesh routers.

However, there may be situations where we don't want to broadcast
an existing hoodfile. We, on the other hand, cannot delete it
then, as we need the file for checking changes in the temporary
hoodfile.
We also cannot just switch the wXconfig state to achieve this
goal, as we need a trigger to do that (which is the same file we
are discussing about).

So, in this patch, we introduce two files, one for the checksum
comparison and one for the hood info broadcast. Those can now be
set and deleted (in a later patch) as it is required by their
respective tasks. This should also improve code clarity to the
reader ...

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-07-25 22:59:57 +02:00
Adrian Schmutzler 845886d16a hood files: Use more meaningful and concise naming scheme
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-07-25 22:59:40 +02:00
Robert Langhammer d09df921e0 Update tunneldigger
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-07-25 14:26:43 +02:00
Adrian Schmutzler a8779c66c9 Data processing notes: Add for SSH access
To provide data processing information for SSH access without
annoying users too much, this adds a pointer to more extensive
information to the banner displayed after login.

The referenced files then contain similar information to what
is shown in the WebUI.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-07-25 14:20:36 +02:00
Adrian Schmutzler 14718ff10b Data processing notes: Add in fff-web
This adds a first version of data processing information to the
Web UI's settings page (where the information is entered).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-07-25 14:20:22 +02:00
Adrian Schmutzler 059a48f95d fff-batman-adv: Remove vis_mode from uci config
According to the upstream repo, vis_mode has been removed since
batman-adv 2014.0.0.

See openwrt-routing/packages 8a66ed1.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-07-25 14:15:32 +02:00
Fabian Bläse b194e8f8cd Remove sectorfile for first release
To reduce the number of possible corner cases
in the first keyxchangev2 release, this patch
removes the sector file with the intention to
add it back after release.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
2018-07-25 14:14:26 +02:00
Adrian Schmutzler b4ab6ed3e9 configurenetwork: Improve output when setting IPv6 addresses
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-06-17 17:55:38 +02:00
Fabian Bläse bce43a3a27 Allow initial configuration from Ethernet
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhgammer <rlanghammer@web.de>
2018-06-16 00:36:37 +02:00
Fabian Bläse bb496df2bc Move hoodfile acquisition into function
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-06-16 00:36:28 +02:00
Tim Niemeyer 1826d39064 Revert "configurehood: Prevent connecting two hoods"
Fixes #95

This reverts commit 6cc6b4b786.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2018-06-11 18:57:50 +02:00
Tim Niemeyer 10109a5045 fff-hoods: call reload_config after uci commit
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2018-06-11 18:57:42 +02:00
Tim Niemeyer c54fcf9b86 fff-hoods: set hood to none if on station mode
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2018-06-11 18:57:35 +02:00
Tim Niemeyer 00767f92ad fff-macnock: new package
Fixes #68

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2018-06-11 18:57:22 +02:00
Robert Langhammer a7544befc5 fff-network: correct path to iptables
Fixes #94

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-03-04 15:48:37 +01:00
Adrian Schmutzler 0f605ec2fd configurehood: Fix "wifi" blocking correct network status detection
In commit 5c1d3b1, conditions were changed so that "wifi" is called
almost every run directly before the network status (internet vs.
gateway contact vs. wXsta).

This causes strange effects configurehood and nodewatcher, which is
called at the same time.

The fix only does "wifi" if required and waits 10 sec. after that.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-03-03 22:23:32 +01:00
Tim Niemeyer bd5985e99e fff-network: enable forwarding; filter forwarding
Fixes #83
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
2018-03-03 21:34:36 +01:00
Tim Niemeyer 6863c6235d fff-network: rework sysctl's
Just disable autoconf.

Some sysctl's are currently not available due some missing kernel
features. Maybe some day they reappear.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
2018-03-03 21:34:36 +01:00
Tim Niemeyer 9f263c1b38 fff-firewall: clean up v6 rules on prepare
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
2018-03-03 21:34:36 +01:00
Tim Niemeyer 7cb79452fd fff-network: move sysctl settings to a function
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
2018-03-03 21:34:36 +01:00
Tim Niemeyer f65b7fc2ab bsp/default: move network sysctl's to fff-network
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
2018-03-03 21:34:35 +01:00
Adrian Schmutzler a86f45c269 fff-web: UPGRADE_PATH in header should be taken from hood file
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-03-03 17:51:38 +01:00
Christian Dresel 9a470994aa Disable VPN if not in use
The simplest and fasted way to
Fixes #72

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-02-13 18:50:31 +01:00
Adrian Schmutzler 55f6182a75 packages/fff: Split fff-hoods into two packages
Code which is reused by other functionalities is put into the
fff-hoodutils package, so it can be used without including
configurehood.

This also allows setting missing dependencies of other packages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-02-11 00:10:41 +01:00
Adrian Schmutzler 5c1d3b1f35 configurehood: Improve conditions for configap setup
This addresses a bunch of issues:
- Previously, only the presence of w2configap was checked. With
  only 5 GHz, this would have caused a recreation every 5 min.
  (Note that this is only valid for a 5 GHz only device, as we
  always create all interfaces for disabled radios)
- The two outer if-statements are merged
- We now check for presence of wXmesh to enable wXconfigap. Although
  this is no necessity (as the hood file contains the whole config)
  this assumes that a disabled wXmesh means no intent of the owner
  to connect to other devices on this radio.
- With the dependency of wXconfigap from wXmesh, this patch now
  enables the deactivation of hood file transmitting by disabling
  meshing in the hood file

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-02-11 00:06:45 +01:00
Adrian Schmutzler 04105ad510 fff-web: Fix two bugs in wifiscan.html
Bug 1: If devices with hidden SSID are present, the matched
SSID in the awk contains the newline (="unknown\n\t"). This
destroys the table after the sort.

Bug 2: If SSIDs contain ampersands (yes, people do that),
they are now converted to &amp;.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-28 12:53:38 +01:00
Adrian Schmutzler 686da98770 nodewatcher: Provide data to calculate airtime
The actual calculation is done in the Monitoring.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-01-28 12:36:14 +01:00
Tim Niemeyer 69b1c6e356 WR841-v7: get routermac from phy0 instead of wlan0
Fixes: #71
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-01-21 14:55:21 +01:00
Adrian Schmutzler 145e057a77 fff-nodewatcher: Add detailed clients data
This adds data about the clients per interface

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-01-21 14:55:19 +01:00
Adrian Schmutzler c7ffb50d3d fff-hoods: Restart alfred after keyxchange file update
This is a workaround to enable alfred on routers which do not see
a configap during initial boot.

Fixes: #78

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-21 13:50:28 +01:00
Adrian Schmutzler ef1ec21462 GL-AR150: Fix ETHMESHMAC
The AR150 seems to have the same MAC address on eth0, eth1 and
phy0. Although it is not a ONEPORT, we can use the shifted bit
like for the ONEPORT devices to get a distinct ETHMESHMAC.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2018-01-21 13:07:29 +01:00
Adrian Schmutzler 568ce35d06 fff-sysupgrade/fff-hoods: Make sectorfile upgradesafe
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 15:20:52 +01:00
Adrian Schmutzler 430049d1b3 fff-hoods: Replace hiddenapflag by check for real conditions
Instead of using the hiddenapflag file, we can just check whether
the hood file copy used by the webserver is present. As a second
condition, we check whether the w2configap is not configured yet.

This fixes the following minor issue:
Previously, if configurehood has run once, the hiddenapflag was
set, but the configap not set up yet. If then a restart happens,
the flag is gone (/tmp), but not recreated until a change in the
hood file appears. Thus, no configap would be set up until that
point.
Since we check for a real condition now, this can't be happening.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 15:16:47 +01:00
Adrian Schmutzler bef333c43b nodewatcher: Fix bugs in gateway list creation
Changes:
- Remove first line (headline) previously parsed as gateway
- Delete leading whitespaces for netif correctly (regex
  "\\[" changed to "\\[ *")
- Remove netif whitespaces first, so they are not changed to
  "false"
- Include trailing whitespace in regex for selection marker
- Remove useless replacement "  " to " "

This is designed to support BATMAN compatibility version 14 AND 15

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 15:11:34 +01:00
Adrian Schmutzler 90c8526873 fff-network: Calculate IPv6 using ROUTERMAC variable
If the mac is read from /sys/class/net/${iface}/address, some
devices (WA860RE, Picostation) will not set the fdff addresses.

This can be fixed by using the $ROUTERMAC in configurenetwork.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 14:48:19 +01:00
Adrian Schmutzler 6ad42be496 fff-network/fff-hoods: Only use MAC address in network lib
Previously, IPv6 addresses were constructed by reading from
the device config file in the function. To have more options,
it is better to use the address itself as parameter.

By this way we can decide what we use for getting the MAC when
calling.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 14:47:58 +01:00
Adrian Schmutzler de36cb4c17 configurenetwork: Put One- and Two-Port pre-setup into function
This is a cosmetical patch, however it does increase the overview
a lot in my opinion.

We cannot drop the special case of the two-port devices, because
we need the current setup to enable setting port mode in the Web
UI.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 13:35:21 +01:00
Christian Dresel 9e0952e01e fff-hoods: Make possible to use fixed hoodfile
Add a complete hoodfile to /etc/hoodfile to use only this file

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
- Changed according to Adrian's review
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 13:06:57 +01:00
Adrian Schmutzler 12804b8ff6 nodewatcher: Provide additional information about WiFi interfaces
This patch additional information to the nodewatcher XML:
- wlan_channel: Channel of interface (number only)
- wlan_ssid: SSID available through iw dev
- wlan_type: Type of interface (AP, mesh, IBSS)
- wlan_width: Width of frequency band (20 vs. 40 MHz, number only)

The nodewatcher file from this patch can be copied manually to
devices with older firmware.

The patch includes some comment typo fixes.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2017-12-31 15:40:59 +01:00
Adrian Schmutzler 6cc6b4b786 configurehood: Prevent connecting two hoods
To prevent connecting hoods, this patch loads keyxchange files
from the local network (eth0.3/eth0) before it uses the gateway.

Thus, if other files are provided via wXconfigap, they are just
ignored. If a router is connected to two hoods by cable, it will
just disable the interfaces where a second hood file is detected
and wait until the next call of configurehood.

If cable and wXmesh are different, the cable has precedence.

If two hoods are present via cable on the same eth, wXmesh has
precedence.

If two hoods are present via cable on different eth, the first
eth has precedence and all others are disabled.

If cable has precedence, wXmesh is configured with the hood
file from cable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-12-23 14:31:01 +01:00