Commit Graph

1084 Commits

Author SHA1 Message Date
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
Fabian Bläse 748c8aec2a Revert openwrt patch which caused too high tx powers
Since the reverted patch, device specific antenna gain is not set for some reason.
Reverting the patch in question fixes this issue.

THIS SHOULD BE ONLY CONSIDERD AS A TEMPORARY FIX UNTIL THE ISSUE IS FIXED PROPERLY!

Fixes: #85

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-21 14:48:47 +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 4a23b1baf7 LEDE: Go back to OpenWRT sources
After the remerge the LEDE git source is broken, thus we switch
to the OpenWRT sources.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-01-03 21:30:30 +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
Adrian Schmutzler 696c983f22 configurehood: Wait for the config AP to build when in sta mode
The configurehood script is started at the same time for all
routers. Thus, if one router sets up its configap, another may
just go into wXsta at the very same moment. This creates a race
condition between configap setup and wXsta download.

To circumvent this, we add a sleep to the wXsta routine, so the
wXsta always comes later, but is still run every 5 minutes.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2017-12-23 13:26:27 +01:00
Christian Dresel 7b0add8c70 Add support for Unifi AC Mesh
This is the correct firmware for the Unifi AC Mesh I have only
tested at Unifi AC Mesh and not at Unifi AC lite But my information
is, that both have the same Hardware

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-23 13:14:06 +01:00
Robert Langhammer 6b296ddf35 Update tunneldigger
We need the new tunneldigger because the old broker no longer works with the current kernel.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
2017-12-23 13:09:32 +01:00
Adrian Schmutzler f9e98f3ebf fff-network: Commit only network
Since we change only the network part of uci, we only need to
commit this part and not the whole config five times.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
- Rebased
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2017-12-23 12:59:07 +01:00
Adrian Schmutzler bac439a254 fff-web: Allow minus (-) in passwords
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-12-23 12:54:14 +01:00
Adrian Schmutzler eff6b0a305 fff-network: Fix second occurrence of ROUTERMAC and ETHMESHMAC
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2017-12-22 14:26:10 +01:00
Robert Langhammer 95507d1728 fastd: generate the key from urandom
We do not use encrypted tunnels, so we can use urandom generating the keys to prevent blocking due to low entropy.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2017-12-22 14:06:05 +01:00
Adrian Schmutzler 8e5e7cba47 fff-web/show_info: Put common code into function
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-13 19:22:44 +01:00
Adrian Schmutzler 232b8bff62 fff-web: Include new options into settings.html
This includes the new options introduced due to the
/etc/config/fff file into the WebUI.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 20:28:59 +01:00
Adrian Schmutzler a4c9978f5a fff-web: Added options to disable update notification
Update notification is enabled by default. If required, this
allows disabling it permanently.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 20:28:56 +01:00
Adrian Schmutzler 84432f7bbf fff-support: Update PoE passthrough code
This implements an upgrade safe solution for the PoE passthrough
on multiple devices. Since LEDE already provides the relevant
settings, a check whether those are in place enables both
identification of affected devices and automatic deactivation
if parameters are changed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 20:28:54 +01:00
Adrian Schmutzler 39d147da8d Rearrange fff config values into their own config file
This moves the FFF configuration from
/etc/config/system to a new file /etc/config/fff. Thus,
this file can be copied as a whole during upgrade (with
compatibility provided) and then resulting values in
other files are re-set later.

This also fixes the bandwidth settings not being persistent
during upgrade. Other settings may join ...

I tried to go through all the code and update all occurrences
of the relevant system variables (looking for "system" both
in GitHub and my local src folder).

Note that a downgrade will result in loss of configuration!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
- Rebased
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 20:28:52 +01:00
Adrian Schmutzler 09a84bdd7b show_info: Display hood information
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 20:28:51 +01:00
Adrian Schmutzler a9b3dfd7e0 fff-web: Show WiFi channels and SSID
This patch introduced more detailed information about the
hood in the WebUI, i.e. channel and SSIDs.

The patch includes a reorganization of the columns.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Tested-By: Fabian Bläse <fabian@blaese.de>
2017-11-12 20:28:49 +01:00
Adrian Schmutzler 1f79cab957 show_info: Add assignment without switch
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2017-11-12 18:21:08 +01:00
Fabian Bläse 7ea8df5264 CPE510: Add ROUTERMAC
This adds missing ROUTERMAC variable for CPE510

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2017-11-12 18:07:51 +01:00
Fabian Bläse 078bb80a53 fff-network: Get MAC from wifi device instead of wifi network
Using wifi devices makes it possible to get mac address
without having to configure wifi networks.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-By: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
- Increment package version
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 18:02:32 +01:00
Tim Niemeyer bdceb7bb6f fff-alfred: do not use bat0 for master selection
During system boot, the dependency of alfred to the bat0
interface is problematic. In some circumstances (no eth mesh
and no wifi mesh), the mesh interfaces are disabled, the
bat0 interface is removed and the station mode is entered.

Because alfred is started after the station mode (current
boot order), it doesn't start up with the missing bat0 interface.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2017-11-12 17:32:33 +01:00
Tim Niemeyer 1b7bfb63cd fff-alfred: new package
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2017-11-12 17:32:23 +01:00
Fabian Bläse f3dd36b8da configurehood: Allow for spaces after identifier
Some JSON beautifiers put spaces between identifier and value.
This is necessary to tolerate that.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 17:28:59 +01:00
Fabian Bläse 1eaa0075fd Use SWITCHDEV variable for mac address fixing
This makes use of the SWITCHDEV variable to ensure that the
correct interface is used for mac address fixing on devices,
that do not use eth0 for the switch.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2017-11-12 17:28:42 +01:00
Adrian Schmutzler 8297da7051 fff-web: Fix style and XHTML conformity in upgrade.html
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2017-11-12 17:26:43 +01:00
Adrian Schmutzler c54596d63f Support subtarget in buildscript
Prepares a subtarget variable for cases where it is not 'generic'

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
- Rebased
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2017-11-04 17:29:31 +01:00
Adrian Schmutzler 56c07144f7 fff-hoods: Suppress warning for missing sectorfile
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-04 15:51:49 +01:00
Tim Niemeyer 90e0643b29 fff-hoods: move hiddenapfile variable
Move the variable definition to the implementation file. This is more
intuitive and the variable is not used otherwise.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-04 15:51:35 +01:00
Adrian Schmutzler 72942057bc fff-hoods/fff-wireless: Don't delete WiFi devices
We only want to remove WiFi interfaces, not devices during
reconfiguration. This still allows for complete reconfiguration,
but does not remove device attributes like a disabled 5 GHz or
similar.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-04 14:49:19 +01:00
Adrian Schmutzler 46d8b9b8b2 fff-network: Fix mac adresses not set during merge/rebase
Some MAC adresses were forgotten/not updated in a previous
patch. This is fixed now.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2017-11-04 11:13:28 +01:00