Compare commits

...

31 Commits

Author SHA1 Message Date
Dennis Eisold 4721f2086e Restored second cronjob 2022-03-07 17:46:04 +01:00
Dennis Eisold b75041997b Send json file directly instead of cat 2022-03-07 11:33:17 +01:00
Dennis Eisold 9c97da67ca Combined crawl data and send data 2022-03-07 11:12:23 +01:00
Dennis Eisold e11cb2d012 Fixed mqtt send 2022-03-07 10:19:50 +01:00
Dennis Eisold b52801fe14 Moved json part to own nodewatcher-json 2022-03-07 10:07:59 +01:00
Dennis Eisold 9cc28b9114 This patch adds json to the mqtt monitoring package.
Signed-off-by: Dennis Eisold <mcules@freifunk-hassberge.de>
2022-03-07 08:52:41 +01:00
Johannes Kimmel 87d923c1ef fff-dhcp: increase dns cachesize
The default cachesize for dnsmasq is 150 entries, which results in a
poor cache hit rate.

Raise the default to 1024 to provide better cache hit rates on all
devices while still keeping memory usage in check.

Further increase the cachesize to 8192 entries for systems with enough
ram (currently more than 64MB).

The memory usage will increase roughly 100B per entry.

The size was chosen empirically. Higher values don't seem to increase
cache hit rate a lot.

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2022-03-05 19:31:00 +01:00
Christian Dresel 0e8c32a363 fff-layer3: add snmp-utils package
This adds snmp-utils support to facilitate testing future uses for s2nproxy

WIP/RFC for s2nproxy:
freifunk-franken/firmware#194

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2022-03-05 18:19:20 +01:00
Fabian Bläse a5ad4a9b00 fff-config: Set panic on OOM
The OOM killer does not make much sense on a router, because regardless
of which process is killed, most of the time some essential core
functionality is affected.

Set the panic on OOM sysctl, so every OOM leads to a kernel panic and
results in a reboot of the router, which restores a clean state.

Fixes: #131

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
2022-03-05 18:19:13 +01:00
Fabian Bläse 17bc1a7e62 fff-layer3-config: Always clear client interface list completely
Previously, some interfaces in the client ifname list have been kept.
The actual reason for this is unknown, it might have been used for the
bat0 interfaces.

Filtering the interface list in this way might lead to interfaces being
retained unintentionally, especially with the diverse naming of DSA
interfaces.

As it is not required anymore, remove the retention of some interfaces
completely.

Fixes: #207

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
2022-03-05 18:19:02 +01:00
Fabian Bläse 330ed1b52d build_patches: Add hack which fixes forwarding on a stacked bridge
Currently we are utilizing stacked bridges to keep configuration of DSA
devices as close as possible to swconfig devices. The lower bridge is
for configuration of the DSA hardware and is vlan-aware, while the upper
bridge is used to connect wireless interfaces to the client interface.

A packet arriving from the switch might have the offload_fwd_mark flag
set in the skb to prevent it from being sent to DSA ports, as this has
already been done in hardware.

However, this flag is not cleared before the skb is processed by the
upper bridge, which prevents it from being sent to any other ports of
that bridge. Therefore, communication is not possible between different
ports of that bridge, while communication with the bridge interface
itself is possible.

This issue affects both the layer3 and node variant, but due to the
layer 2 architecture of the node firmware, it is far more noticeable in
the node firmware, as it prevents ethernet clients from sending packets
to the gateway.

Work around this issue by clearing the offload_fwd_mark flag before
passing the skb up.

Fixes: #205

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
2022-03-05 18:18:51 +01:00
Fabian Bläse 5b23824344 fff-network: Remove hardcoded network config
The base network configuration has been completely migrated to
uci-defaults scripts and any existing network configuration is dropped.

Therefore, the hardcoded /etc/config/network configuration file is not
required anymore. Remove it.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-03-05 18:18:47 +01:00
Fabian Bläse 5424eb728c fff-network: restore accidentally removed packet_steering option
With the recent rework of the network configuration, any existing
configuration is dropped in a uci-defaults script (22-network-base) and
generated from scratch. When rebasing this rather old patchset, the
packet_steering option was overlooked, so it is missing now.

Restore the removed packet_steering option by setting it using a
dedicated uci-defaults script.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-03-05 18:18:21 +01:00
Fabian Bläse 209c9debbf treewide: reorder layer3-specific uci-default scripts
With a recent patchset the initial boot process of the fff-network
package has been significantly altered. The base network configuration
is now generated by a uci-defaults script which completely drops
any existing network configuration first (22-network-base).

Reorder some uci-defaults scripts which extend the base network
configuration with layer3-specific rules, so they are executed after
22-network-base.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-03-05 18:18:02 +01:00
Fabian Bläse 1c3328e64a Remove static configuration from dynamic script
Most of the configuration done in configurenetwork is static and does
not change after the first boot. Move this static configuration into a
uci-defaults script, which is only executed on first boot.

Configuration which might be changed at runtime (e.g. port assignment),
is kept in the configurenetwork script.

To improve readability and speed, combine multiple uci commands into a
uci batch. Drop any existing network configuration before applying our
own configuration. This requires the network.globals section to be
created explicitly. Also, the fdff:: addresses, ETHMESHMAC and ROUTERMAC
can be set unconditionally, as the uci-defaults script is only executed
once. Other than that, the static configuration has not been altered.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-03-05 18:18:00 +01:00
Fabian Bläse a8ce8e1ad6 fff-network: Remove unnecessary restart of fff-uradvd
The explicit restat of fff-uradvd is not necessary anymore, as
appropriate procd reload triggers have been added, and reload_config is
executed after every run of configurenetwork.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-03-05 18:17:59 +01:00
Fabian Bläse 3f765e4ba7 fff-network: Replace runtime configuration with reload_config
Instead of both setting values in the uci configuration and applying
them manually, only set the values in the uci configuration and do a
combined reload_config afterward.

This not only ensures that the changes to the configuration are actually
correct, but also decreases the runtime of configurenetwork.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-03-05 18:17:58 +01:00
Fabian Bläse 1917c8a1df fff-uradvd: Add reload trigger for network
fff-uradvd depends on values stored in the uci network config.
Therefore, a reload is required if the uci network config is modified.

As fff-uradvd does not support reloads, and possibly changing values are
given as command parameters, do a restart on procd reload.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2022-03-05 18:17:25 +01:00
Fabian Bläse c2f80c9999 OpenWrt: bump to v21.02.2
Bump core, packages and routing.

Remove upstreamed build patches.

Remove ath10k memory hack and use the newly added ath10k-smallbuffers
variant instead, but only for devices which actually require it
(and therefore use ath10k-ct-smallbuffers by default).

Adjust for the newly introduced band option for wireless devices, which
is now emitted by OpenWrt by default.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
2022-03-05 18:09:49 +01:00
Adrian Schmutzler 27baecaf37 treewide: set PKG_RELEASE automatically
COMMITCOUNT allows to have the PKG_RELEASE calculated automatically
based on the number of commits for the package folder.

AUTORELEASE will count the number of commits since the last upstream
bump. This is relevant for packages with PKG_VERSION or
PKG_SOURCE_DATE set, but will not work for us since it assumes the
use of certain identifiers in commit titles.

COMMITCOUNT works fine for most of our packages, with the following
exceptions:

 * fff-nodewatcher would yield a commit count of 55, while the
   current PKG_RELEASE is 61. Thus, we do not touch it for now.

 * Packages that have been renamed will start counting from 1 after
   the rename, since folder renames are not tracked by git. This
   will result in descreasing PKG_RELEASE after the change for
   these packages.
   However, since moving essentially creates a new package anyway,
   counting from 1 makes sense conceptually, and PKG_RELEASE is
   still replaced for these packages.

 * alfred-json and fff-macnock use upstream code and thus would
   normally require AUTORELEASE. As discussed above, this will
   not work for us, so just leave these two untouched.

Note that all this is quite irrelevant for the way we use packages
currently, as without opkg PKG_RELEASE does not matter to us anyway.
So, let's just be happy about not having to bump PKG_RELEASE
anymore, while keeping the basic functionality intact.

The only package where the PKG_RELEASE is actually used for
something is fff-nodewatcher, where the version will be displayed
in the Monitoring.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[fabian@blaese.de: rebase, add new packages]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
2022-01-09 22:03:09 +01:00
Christian Dresel 825d760bd8 Add package fff-layer3-snat
With this new package it is possible to do SNAT for client IPv4.

The user must set a router_ip in gateway.meta.router_ip, so an ip
address is available for peering interfaces and reachability.

Currently, no extra filtering is done, so the client interface should
only use ip ranges, which are already filtered from being announced
(e.g. 192.168.0.0/16).

Using NAT for IPv4 significantly reduces the need for big
Freifunk-global IP range allocations.

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
Co-authored-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Christian Dresel <freifunk@dresel.systems>
2022-01-09 21:58:30 +01:00
Fabian Bläse 51ec3648cf fff-babeld: Simplify CIDR mask removal
The removal of CIDR masks from ip addresses is changed to utilize
variable substitutions, which simplifies the expression.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
2022-01-06 01:07:17 +01:00
Fabian Bläse 8ef6dba5a1 fff-babeld: Only select first list entry from router_ip
The router_ip option can be a list of multiple ip addresses. It is also
possible to specify a subnet using a CIDR mask.

Only a single ip is required for peering interfaces, so select only the
first list entry and remove the CIDR mask.

Fixes: #197

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2022-01-06 01:07:15 +01:00
Robert Langhammer a6b90f1a83 vxlan-node-vpn: add initial vid
Without a vid, netifd is running in an ifup-loop.
This situation is comming up after firstboot. An existing hoodfile causes a set vid.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
2022-01-05 22:18:20 +01:00
Robert Langhammer 085dbb64fe fff-fastd: Add batman hardif hop_penalty
Openwrt v21.02.0 contains a new Batman Adv that now offers hop_penalty per hardif.
We can use this to prefer one tunnel for outgoing traffic if there are several VPNs. Eg. fastd and vxlan.

This Patch sets the hop_penalty for the fastd tunnel to 30.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Acked-by: Fabian Bläse <fabian@blaese.de>
2021-12-30 16:21:47 +01:00
Robert Langhammer 12f60419cd fff-node: Add package fff-vxlan-node-vpn
This package adds vxlan support to the node variant and configures the vxlan-vpn tunnels to the gateways.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Acked-by: Fabian Bläse <fabian@blaese.de>

---
A vpn section for vxlan in hoodfile:

    "vpn": [
       {
        "name": "gatewayname",
        "protocol": "vxlan",
        "address": "gateway.url" (or IP)
       }

"name" is optional.
---
2021-12-30 16:21:37 +01:00
Robert Langhammer 1febd2a9b2 fff-vpn-select: Make vpn-select modular
This rewrite makes vpn-select modular to easely add new vpn-protocols.

The stuff dependent on the vpn-protocol is outsourced to files in /usr/lib/vpn-select.d/ and comes in with the respective vpn package. In this way it is easy to select or deselect vpnprotocols to be build in.

vpn-stop is removed to use the protocol independent start/stop mechanism of vpn-select. Instead, a symlink is used.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2021-12-30 16:21:29 +01:00
Johannes Kimmel feeead6c43 fff-firewall: remove obsolete rules
20-clamp-mss:

Clamping is done in other parts of the network and to a very low static
value. This rules is very likely doing nothing at the moment.

20-filter-ssh:

These rules make use of the conntrack module to ratelimit incoming
connections. Using conntrack comes with a performance penalty for all
traffic. As an alternative, dropbear could be run behind an inetd(-like)
service that does the ratelimit, should removing this rule result in an
actual attack vector.

Removing both rules would enable us to unload the conntrack module all
together, potentially improving overall performance.

Fixes #183

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Acked-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2021-12-30 16:02:02 +01:00
Johannes Kimmel 9d745d0d5c fff-layer3-config: add missing -q option for uci get
Suppresses the unhelpful "uci: Entry not found" message when running
configure-layer3 -c in case there is no `ip6addr` set on the client
interface.

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2021-12-30 16:01:44 +01:00
Fabian Bläse 7c3f3230ff buildscript: Split removal of chipset and subtarget
Some OpenWrt targets do not have subtargets. The filename only contains
the chipset in that case. Split the removal of chipset and subtarget
into multiple expressions, so the removal of the chipset works on
targets without subtargets as well.

Fixes: #187

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2021-12-30 16:01:36 +01:00
Fabian Bläse a3d62c7fcc Revert "Retain old compat_version for sysupgrade compatibility"
This reverts commit de9d4abf44.

As the compat_version has been bumped with the last release, this hack
can be removed, because the compat_version now is in sync with upstream.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2021-12-30 16:01:12 +01:00
74 changed files with 1050 additions and 4696 deletions

View File

@ -7,11 +7,11 @@ CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_glinet_gl-ar150=y
CONFIG_TARGET_DEVICE_PACKAGES_ath79_generic_DEVICE_glinet_gl-ar150=""
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_archer-c25-v1=y
CONFIG_TARGET_DEVICE_PACKAGES_ath79_generic_DEVICE_tplink_archer-c25-v1="-kmod-ath10k-ct-smallbuffers kmod-ath10k -ath10k-firmware-qca9887-ct ath10k-firmware-qca9887"
CONFIG_TARGET_DEVICE_PACKAGES_ath79_generic_DEVICE_tplink_archer-c25-v1="-kmod-ath10k-ct-smallbuffers kmod-ath10k-smallbuffers -ath10k-firmware-qca9887-ct ath10k-firmware-qca9887"
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_archer-c60-v1=y
CONFIG_TARGET_DEVICE_PACKAGES_ath79_generic_DEVICE_tplink_archer-c60-v1="-kmod-ath10k-ct-smallbuffers kmod-ath10k -ath10k-firmware-qca9888-ct ath10k-firmware-qca9888"
CONFIG_TARGET_DEVICE_PACKAGES_ath79_generic_DEVICE_tplink_archer-c60-v1="-kmod-ath10k-ct-smallbuffers kmod-ath10k-smallbuffers -ath10k-firmware-qca9888-ct ath10k-firmware-qca9888"
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_archer-c60-v2=y
CONFIG_TARGET_DEVICE_PACKAGES_ath79_generic_DEVICE_tplink_archer-c60-v2="-kmod-ath10k-ct-smallbuffers kmod-ath10k -ath10k-firmware-qca9888-ct ath10k-firmware-qca9888"
CONFIG_TARGET_DEVICE_PACKAGES_ath79_generic_DEVICE_tplink_archer-c60-v2="-kmod-ath10k-ct-smallbuffers kmod-ath10k-smallbuffers -ath10k-firmware-qca9888-ct ath10k-firmware-qca9888"
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_archer-c7-v2=y
CONFIG_TARGET_DEVICE_PACKAGES_ath79_generic_DEVICE_tplink_archer-c7-v2="-kmod-ath10k-ct kmod-ath10k -ath10k-firmware-qca988x-ct ath10k-firmware-qca988x"
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_archer-c7-v5=y
@ -88,6 +88,7 @@ CONFIG_PACKAGE_wpad-mini=m
CONFIG_PACKAGE_ath10k-firmware-qca9887=m
CONFIG_PACKAGE_ath10k-firmware-qca9888=m
CONFIG_PACKAGE_ath10k-firmware-qca988x=m
CONFIG_PACKAGE_kmod-ath10k-smallbuffers=m
CONFIG_PACKAGE_kmod-ath10k=m
CONFIG_PACKAGE_ath10k-firmware-qca9887-ct=m
CONFIG_PACKAGE_ath10k-firmware-qca9888-ct=m

View File

@ -1,890 +0,0 @@
From 0b7311300b01d9975e9996327ee469e4f66fb2ec Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 6 Nov 2021 19:29:39 +0000
Subject: [PATCH] kernel: bump 5.4 to 5.4.158
Removed upstreamed:
generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch
All others updated automatically.
Compile-tested on: lantiq/xrx200, armvirt/64
Runtime-tested on: lantiq/xrx200, armvirt/64
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
include/kernel-version.mk | 4 +-
...mware-loader-for-uPD720201-and-uPD72.patch | 10 ++--
.../802-usb-xhci-force-msi-renesas-xhci.patch | 2 +-
...Show-that-the-VIA-VL805-supports-LPM.patch | 2 +-
...-for-updating-interrupt-endpoint-int.patch | 4 +-
...hci_fixup_endpoint-for-interval-adju.patch | 4 +-
...or-host-controllers-that-don-t-updat.patch | 6 +-
...-0504-mmc-sdhci-Silence-MMC-warnings.patch | 4 +-
...-quirks-add-link-TRB-quirk-for-VL805.patch | 4 +-
...ast-GRO-for-skbs-with-Ethernet-heade.patch | 2 +-
...-net-phy-add-core-phylib-sfp-support.patch | 4 +-
...-not-propagate-bridge-updates-across.patch | 60 -------------------
...sfs-attributes-for-VPD-pages-0h-and-.patch | 10 ++--
.../generic/hack-5.4/220-gc_sections.patch | 2 +-
.../generic/hack-5.4/721-phy_packets.patch | 2 +-
...ng-with-source-address-failed-policy.patch | 26 ++++----
...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 ++--
...dd-support-for-threaded-NAPI-polling.patch | 14 ++---
.../811-pci_disable_usb_common_quirks.patch | 2 +-
...arch-arm-force-ZRELADDR-on-arch-qcom.patch | 2 +-
...Mangle-bootloader-s-kernel-arguments.patch | 2 +-
.../900-arm-add-cmdline-override.patch | 2 +-
...5-NET-MIPS-lantiq-adds-xrx200-legacy.patch | 2 +-
...move-EH-SINGLE_STEP_SET_FEATURE-impl.patch | 4 +-
...host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch | 4 +-
...host-xhci-do-not-return-error-status.patch | 2 +-
...-host-xhci-add-.bus_suspend-override.patch | 2 +-
.../901-fix_irq_type_of_pca953x.patch | 2 +-
...Mangle-bootloader-s-kernel-arguments.patch | 2 +-
...Mangle-bootloader-s-kernel-arguments.patch | 2 +-
.../patches-5.4/200-add-ralink-eth.patch | 2 +-
.../990-NET-no-auto-carrier-off-support.patch | 4 +-
...net-add-support-for-rtl838x-ethernet.patch | 2 +-
33 files changed, 73 insertions(+), 133 deletions(-)
delete mode 100644 target/linux/generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch
diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 83bfcd8ff2..688660cbbd 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif
-LINUX_VERSION-5.4 = .154
+LINUX_VERSION-5.4 = .158
-LINUX_KERNEL_HASH-5.4.154 = 058994f4666b6b0474a4d5228583e394594e406783b7e93d487c2a66c35f3c06
+LINUX_KERNEL_HASH-5.4.158 = 6e018fecdc8fc24553756e582d83b82d65b10a6b03ef36262a24911f839b8d59
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
diff --git a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
index 980a0407db..220e5da73b 100644
--- a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
+++ b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
@@ -48,7 +48,7 @@ Signed-off-by: Vinod Koul <vkoul@kernel.org>
#include "xhci.h"
#include "xhci-trace.h"
-@@ -64,6 +66,44 @@
+@@ -65,6 +67,44 @@
#define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142
#define PCI_DEVICE_ID_ASMEDIA_3242_XHCI 0x3242
@@ -93,7 +93,7 @@ Signed-off-by: Vinod Koul <vkoul@kernel.org>
static const char hcd_name[] = "xhci_hcd";
static struct hc_driver __read_mostly xhci_pci_hc_driver;
-@@ -309,6 +349,873 @@ static void xhci_pme_acpi_rtd3_enable(st
+@@ -311,6 +351,873 @@ static void xhci_pme_acpi_rtd3_enable(st
static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
#endif /* CONFIG_ACPI */
@@ -967,7 +967,7 @@ Signed-off-by: Vinod Koul <vkoul@kernel.org>
/* called during probe() after chip reset completes */
static int xhci_pci_setup(struct usb_hcd *hcd)
{
-@@ -350,6 +1257,27 @@ static int xhci_pci_probe(struct pci_dev
+@@ -352,6 +1259,27 @@ static int xhci_pci_probe(struct pci_dev
struct hc_driver *driver;
struct usb_hcd *hcd;
@@ -995,7 +995,7 @@ Signed-off-by: Vinod Koul <vkoul@kernel.org>
driver = (struct hc_driver *)id->driver_data;
/* Prevent runtime suspending between USB-2 and USB-3 initialization */
-@@ -411,6 +1339,16 @@ static void xhci_pci_remove(struct pci_d
+@@ -413,6 +1341,16 @@ static void xhci_pci_remove(struct pci_d
{
struct xhci_hcd *xhci;
@@ -1012,7 +1012,7 @@ Signed-off-by: Vinod Koul <vkoul@kernel.org>
xhci = hcd_to_xhci(pci_get_drvdata(dev));
xhci->xhc_state |= XHCI_STATE_REMOVING;
-@@ -550,6 +1488,11 @@ static int xhci_pci_resume(struct usb_hc
+@@ -552,6 +1490,11 @@ static int xhci_pci_resume(struct usb_hc
if (pdev->vendor == PCI_VENDOR_ID_INTEL)
usb_enable_intel_xhci_ports(pdev);
diff --git a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch
index 4217a1e949..6980ce80ee 100644
--- a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch
+++ b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch
@@ -13,7 +13,7 @@ produce a noisy warning.
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
-@@ -288,6 +288,7 @@ static void xhci_pci_quirks(struct devic
+@@ -290,6 +290,7 @@ static void xhci_pci_quirks(struct devic
pdev->device == 0x0015) {
xhci->quirks |= XHCI_RESET_ON_RESUME;
xhci->quirks |= XHCI_ZERO_64B_REGS;
diff --git a/target/linux/bcm27xx/patches-5.4/950-0211-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch b/target/linux/bcm27xx/patches-5.4/950-0211-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch
index 5679126103..cf3cb58362 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0211-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0211-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch
@@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
-@@ -257,6 +257,10 @@ static void xhci_pci_quirks(struct devic
+@@ -259,6 +259,10 @@ static void xhci_pci_quirks(struct devic
pdev->device == 0x3432)
xhci->quirks |= XHCI_BROKEN_STREAMS;
diff --git a/target/linux/bcm27xx/patches-5.4/950-0218-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch b/target/linux/bcm27xx/patches-5.4/950-0218-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch
index 9e886ee2df..f654cd8a57 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0218-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0218-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch
@@ -81,7 +81,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
extern int usb_driver_set_configuration(struct usb_device *udev, int config);
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
-@@ -384,6 +384,11 @@ struct hc_driver {
+@@ -382,6 +382,11 @@ struct hc_driver {
* or bandwidth constraints.
*/
void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
@@ -93,7 +93,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
/* Returns the hardware-chosen device address */
int (*address_device)(struct usb_hcd *, struct usb_device *udev);
/* prepares the hardware to send commands to the device */
-@@ -445,6 +450,8 @@ extern void usb_hcd_unmap_urb_setup_for_
+@@ -443,6 +448,8 @@ extern void usb_hcd_unmap_urb_setup_for_
extern void usb_hcd_unmap_urb_for_dma(struct usb_hcd *, struct urb *);
extern void usb_hcd_flush_endpoint(struct usb_device *udev,
struct usb_host_endpoint *ep);
diff --git a/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
index 1016627521..b316ef8180 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
@@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
-@@ -1469,6 +1469,103 @@ command_cleanup:
+@@ -1468,6 +1468,103 @@ command_cleanup:
}
/*
@@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
* non-error returns are a promise to giveback() the urb later
* we drop ownership so next owner (or urb unlink) can get it
*/
-@@ -5358,6 +5455,7 @@ static const struct hc_driver xhci_hc_dr
+@@ -5362,6 +5459,7 @@ static const struct hc_driver xhci_hc_dr
.endpoint_reset = xhci_endpoint_reset,
.check_bandwidth = xhci_check_bandwidth,
.reset_bandwidth = xhci_reset_bandwidth,
diff --git a/target/linux/bcm27xx/patches-5.4/950-0264-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch b/target/linux/bcm27xx/patches-5.4/950-0264-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch
index 947b00b398..683f0905ef 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0264-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0264-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch
@@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
-@@ -258,8 +258,10 @@ static void xhci_pci_quirks(struct devic
+@@ -260,8 +260,10 @@ static void xhci_pci_quirks(struct devic
xhci->quirks |= XHCI_BROKEN_STREAMS;
if (pdev->vendor == PCI_VENDOR_ID_VIA &&
@@ -37,7 +37,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI)
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
-@@ -550,7 +550,10 @@ void xhci_find_new_dequeue_state(struct
+@@ -556,7 +556,10 @@ void xhci_find_new_dequeue_state(struct
struct xhci_virt_ep *ep = &dev->eps[ep_index];
struct xhci_ring *ep_ring;
struct xhci_segment *new_seg;
@@ -48,7 +48,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
dma_addr_t addr;
u64 hw_dequeue;
bool cycle_found = false;
-@@ -588,7 +591,28 @@ void xhci_find_new_dequeue_state(struct
+@@ -594,7 +597,28 @@ void xhci_find_new_dequeue_state(struct
hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id);
new_seg = ep_ring->deq_seg;
new_deq = ep_ring->dequeue;
diff --git a/target/linux/bcm27xx/patches-5.4/950-0504-mmc-sdhci-Silence-MMC-warnings.patch b/target/linux/bcm27xx/patches-5.4/950-0504-mmc-sdhci-Silence-MMC-warnings.patch
index 89fd58dca0..ba815eecfd 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0504-mmc-sdhci-Silence-MMC-warnings.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0504-mmc-sdhci-Silence-MMC-warnings.patch
@@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
#define MAX_TUNING_LOOP 40
-@@ -2762,7 +2762,7 @@ static void sdhci_timeout_timer(struct t
+@@ -2768,7 +2768,7 @@ static void sdhci_timeout_timer(struct t
spin_lock_irqsave(&host->lock, flags);
if (host->cmd && !sdhci_data_line_cmd(host->cmd)) {
@@ -31,7 +31,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
mmc_hostname(host->mmc));
sdhci_dumpregs(host);
-@@ -2784,7 +2784,7 @@ static void sdhci_timeout_data_timer(str
+@@ -2790,7 +2790,7 @@ static void sdhci_timeout_data_timer(str
if (host->data || host->data_cmd ||
(host->cmd && sdhci_data_line_cmd(host->cmd))) {
diff --git a/target/linux/bcm27xx/patches-5.4/950-0993-xhci-quirks-add-link-TRB-quirk-for-VL805.patch b/target/linux/bcm27xx/patches-5.4/950-0993-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
index 627ec30f06..cc05573eb0 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0993-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0993-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
-@@ -261,6 +261,7 @@ static void xhci_pci_quirks(struct devic
+@@ -263,6 +263,7 @@ static void xhci_pci_quirks(struct devic
pdev->device == 0x3483) {
xhci->quirks |= XHCI_LPM_SUPPORT;
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
@@ -32,7 +32,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
-@@ -647,6 +647,16 @@ void xhci_find_new_dequeue_state(struct
+@@ -653,6 +653,16 @@ void xhci_find_new_dequeue_state(struct
} while (!cycle_found || !td_last_trb_found);
diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
index eeea18bb9c..13f0d9d000 100644
--- a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
+++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
@@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -5423,8 +5423,7 @@ static inline void skb_gro_reset_offset(
+@@ -5429,8 +5429,7 @@ static inline void skb_gro_reset_offset(
NAPI_GRO_CB(skb)->frag0 = NULL;
NAPI_GRO_CB(skb)->frag0_len = 0;
diff --git a/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch b/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch
index 11da9540e9..edfe151725 100644
--- a/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch
+++ b/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch
@@ -24,7 +24,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
#include <linux/workqueue.h>
#include <linux/mdio.h>
#include <linux/io.h>
-@@ -843,6 +844,9 @@ void phy_stop(struct phy_device *phydev)
+@@ -863,6 +864,9 @@ void phy_stop(struct phy_device *phydev)
mutex_lock(&phydev->lock);
@@ -34,7 +34,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
phydev->state = PHY_HALTED;
mutex_unlock(&phydev->lock);
-@@ -905,6 +909,9 @@ void phy_state_machine(struct work_struc
+@@ -925,6 +929,9 @@ void phy_state_machine(struct work_struc
old_state = phydev->state;
diff --git a/target/linux/generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch b/target/linux/generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch
deleted file mode 100644
index bc8014b772..0000000000
--- a/target/linux/generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 07c6f9805f12f1bb538ef165a092b300350384aa Mon Sep 17 00:00:00 2001
-From: Russell King <rmk+kernel@armlinux.org.uk>
-Date: Wed, 26 Feb 2020 17:14:21 +0000
-Subject: [PATCH] net: switchdev: do not propagate bridge updates across
- bridges
-
-When configuring a tree of independent bridges, propagating changes
-from the upper bridge across a bridge master to the lower bridge
-ports brings surprises.
-
-For example, a lower bridge may have vlan filtering enabled. It
-may have a vlan interface attached to the bridge master, which may
-then be incorporated into another bridge. As soon as the lower
-bridge vlan interface is attached to the upper bridge, the lower
-bridge has vlan filtering disabled.
-
-This occurs because switchdev recursively applies its changes to
-all lower devices no matter what.
-
-Reviewed-by: Ido Schimmel <idosch@mellanox.com>
-Tested-by: Ido Schimmel <idosch@mellanox.com>
-Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- net/switchdev/switchdev.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
---- a/net/switchdev/switchdev.c
-+++ b/net/switchdev/switchdev.c
-@@ -476,6 +476,9 @@ static int __switchdev_handle_port_obj_a
- * necessary to go through this helper.
- */
- netdev_for_each_lower_dev(dev, lower_dev, iter) {
-+ if (netif_is_bridge_master(lower_dev))
-+ continue;
-+
- err = __switchdev_handle_port_obj_add(lower_dev, port_obj_info,
- check_cb, add_cb);
- if (err && err != -EOPNOTSUPP)
-@@ -528,6 +531,9 @@ static int __switchdev_handle_port_obj_d
- * necessary to go through this helper.
- */
- netdev_for_each_lower_dev(dev, lower_dev, iter) {
-+ if (netif_is_bridge_master(lower_dev))
-+ continue;
-+
- err = __switchdev_handle_port_obj_del(lower_dev, port_obj_info,
- check_cb, del_cb);
- if (err && err != -EOPNOTSUPP)
-@@ -579,6 +585,9 @@ static int __switchdev_handle_port_attr_
- * necessary to go through this helper.
- */
- netdev_for_each_lower_dev(dev, lower_dev, iter) {
-+ if (netif_is_bridge_master(lower_dev))
-+ continue;
-+
- err = __switchdev_handle_port_attr_set(lower_dev, port_attr_info,
- check_cb, set_cb);
- if (err && err != -EOPNOTSUPP)
diff --git a/target/linux/generic/backport-5.4/800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch b/target/linux/generic/backport-5.4/800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch
index 438588f9f4..8c18d5df6d 100644
--- a/target/linux/generic/backport-5.4/800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch
+++ b/target/linux/generic/backport-5.4/800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch
@@ -41,9 +41,9 @@ Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
struct scsi_vpd *vpd_pg80 = NULL, *vpd_pg83 = NULL;
+ struct scsi_vpd *vpd_pg0 = NULL, *vpd_pg89 = NULL;
unsigned long flags;
+ struct module *mod;
- sdev = container_of(work, struct scsi_device, ew.work);
-@@ -466,16 +467,24 @@ static void scsi_device_dev_release_user
+@@ -469,16 +470,24 @@ static void scsi_device_dev_release_user
sdev->request_queue = NULL;
mutex_lock(&sdev->inquiry_mutex);
@@ -68,7 +68,7 @@ Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
kfree(sdev->inquiry);
kfree(sdev);
-@@ -874,6 +883,8 @@ static struct bin_attribute dev_attr_vpd
+@@ -883,6 +892,8 @@ static struct bin_attribute dev_attr_vpd
sdev_vpd_pg_attr(pg83);
sdev_vpd_pg_attr(pg80);
@@ -77,7 +77,7 @@ Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
static ssize_t show_inquiry(struct file *filep, struct kobject *kobj,
struct bin_attribute *bin_attr,
-@@ -1206,12 +1217,18 @@ static umode_t scsi_sdev_bin_attr_is_vis
+@@ -1215,12 +1226,18 @@ static umode_t scsi_sdev_bin_attr_is_vis
struct scsi_device *sdev = to_scsi_device(dev);
@@ -96,7 +96,7 @@ Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
return S_IRUGO;
}
-@@ -1254,8 +1271,10 @@ static struct attribute *scsi_sdev_attrs
+@@ -1263,8 +1280,10 @@ static struct attribute *scsi_sdev_attrs
};
static struct bin_attribute *scsi_sdev_bin_attrs[] = {
diff --git a/target/linux/generic/hack-5.4/220-gc_sections.patch b/target/linux/generic/hack-5.4/220-gc_sections.patch
index 6207eb0ec9..fdfaf51406 100644
--- a/target/linux/generic/hack-5.4/220-gc_sections.patch
+++ b/target/linux/generic/hack-5.4/220-gc_sections.patch
@@ -21,7 +21,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -111,6 +111,7 @@ config ARM
+@@ -112,6 +112,7 @@ config ARM
select HAVE_UID16
select HAVE_VIRT_CPU_ACCOUNTING_GEN
select IRQ_FORCED_THREADING
diff --git a/target/linux/generic/hack-5.4/721-phy_packets.patch b/target/linux/generic/hack-5.4/721-phy_packets.patch
index 836fc54ba2..bc9b3a4783 100644
--- a/target/linux/generic/hack-5.4/721-phy_packets.patch
+++ b/target/linux/generic/hack-5.4/721-phy_packets.patch
@@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
help
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -3192,10 +3192,20 @@ static int xmit_one(struct sk_buff *skb,
+@@ -3198,10 +3198,20 @@ static int xmit_one(struct sk_buff *skb,
if (dev_nit_active(dev))
dev_queue_xmit_nit(skb, dev);
diff --git a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
index 0b95eee494..06227cfafe 100644
--- a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
+++ b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
@@ -110,7 +110,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
return -EINVAL;
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
-@@ -93,6 +93,8 @@ static int ip6_pkt_discard(struct sk_bu
+@@ -94,6 +94,8 @@ static int ip6_pkt_discard(struct sk_bu
static int ip6_pkt_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb);
static int ip6_pkt_prohibit(struct sk_buff *skb);
static int ip6_pkt_prohibit_out(struct net *net, struct sock *sk, struct sk_buff *skb);
@@ -119,7 +119,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static void ip6_link_failure(struct sk_buff *skb);
static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb, u32 mtu,
-@@ -326,6 +328,18 @@ static const struct rt6_info ip6_prohibi
+@@ -327,6 +329,18 @@ static const struct rt6_info ip6_prohibi
.rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP),
};
@@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static const struct rt6_info ip6_blk_hole_entry_template = {
.dst = {
.__refcnt = ATOMIC_INIT(1),
-@@ -1047,6 +1061,7 @@ static const int fib6_prop[RTN_MAX + 1]
+@@ -1048,6 +1062,7 @@ static const int fib6_prop[RTN_MAX + 1]
[RTN_BLACKHOLE] = -EINVAL,
[RTN_UNREACHABLE] = -EHOSTUNREACH,
[RTN_PROHIBIT] = -EACCES,
@@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
[RTN_THROW] = -EAGAIN,
[RTN_NAT] = -EINVAL,
[RTN_XRESOLVE] = -EINVAL,
-@@ -1084,6 +1099,10 @@ static void ip6_rt_init_dst_reject(struc
+@@ -1085,6 +1100,10 @@ static void ip6_rt_init_dst_reject(struc
rt->dst.output = ip6_pkt_prohibit_out;
rt->dst.input = ip6_pkt_prohibit;
break;
@@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
case RTN_THROW:
case RTN_UNREACHABLE:
default:
-@@ -4426,6 +4445,17 @@ static int ip6_pkt_prohibit_out(struct n
+@@ -4434,6 +4453,17 @@ static int ip6_pkt_prohibit_out(struct n
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
}
@@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
/*
* Allocate a dst for local (unicast / anycast) address.
*/
-@@ -4906,7 +4936,8 @@ static int rtm_to_fib6_config(struct sk_
+@@ -4914,7 +4944,8 @@ static int rtm_to_fib6_config(struct sk_
if (rtm->rtm_type == RTN_UNREACHABLE ||
rtm->rtm_type == RTN_BLACKHOLE ||
rtm->rtm_type == RTN_PROHIBIT ||
@@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
cfg->fc_flags |= RTF_REJECT;
if (rtm->rtm_type == RTN_LOCAL)
-@@ -6029,6 +6060,8 @@ static int ip6_route_dev_notify(struct n
+@@ -6037,6 +6068,8 @@ static int ip6_route_dev_notify(struct n
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
@@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
#endif
-@@ -6040,6 +6073,7 @@ static int ip6_route_dev_notify(struct n
+@@ -6048,6 +6081,7 @@ static int ip6_route_dev_notify(struct n
in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
@@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
#endif
}
-@@ -6232,6 +6266,8 @@ static int __net_init ip6_route_net_init
+@@ -6240,6 +6274,8 @@ static int __net_init ip6_route_net_init
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
net->ipv6.fib6_has_custom_rules = false;
@@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
sizeof(*net->ipv6.ip6_prohibit_entry),
GFP_KERNEL);
-@@ -6242,11 +6278,21 @@ static int __net_init ip6_route_net_init
+@@ -6250,11 +6286,21 @@ static int __net_init ip6_route_net_init
ip6_template_metrics, true);
INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached);
@@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
ip6_template_metrics, true);
-@@ -6270,6 +6316,8 @@ out:
+@@ -6278,6 +6324,8 @@ out:
return ret;
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
out_ip6_prohibit_entry:
kfree(net->ipv6.ip6_prohibit_entry);
out_ip6_null_entry:
-@@ -6289,6 +6337,7 @@ static void __net_exit ip6_route_net_exi
+@@ -6297,6 +6345,7 @@ static void __net_exit ip6_route_net_exi
kfree(net->ipv6.ip6_null_entry);
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
kfree(net->ipv6.ip6_prohibit_entry);
@@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
kfree(net->ipv6.ip6_blk_hole_entry);
#endif
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
-@@ -6366,6 +6415,9 @@ void __init ip6_route_init_special_entri
+@@ -6374,6 +6423,9 @@ void __init ip6_route_init_special_entri
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index 4839ac5e70..e0540866c6 100644
--- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
__u16 tc_index; /* traffic control index */
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -5489,6 +5489,9 @@ static enum gro_result dev_gro_receive(s
+@@ -5495,6 +5495,9 @@ static enum gro_result dev_gro_receive(s
int same_flow;
int grow;
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (netif_elide_gro(skb->dev))
goto normal;
-@@ -7291,6 +7294,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -7297,6 +7300,48 @@ static void __netdev_adjacent_dev_unlink
&upper_dev->adj_list.lower);
}
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int __netdev_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev, bool master,
void *upper_priv, void *upper_info,
-@@ -7341,6 +7386,7 @@ static int __netdev_upper_dev_link(struc
+@@ -7347,6 +7392,7 @@ static int __netdev_upper_dev_link(struc
if (ret)
return ret;
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
&changeupper_info.info);
ret = notifier_to_errno(ret);
-@@ -7434,6 +7480,7 @@ void netdev_upper_dev_unlink(struct net_
+@@ -7440,6 +7486,7 @@ void netdev_upper_dev_unlink(struct net_
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
&changeupper_info.info);
-@@ -8164,6 +8211,7 @@ int dev_set_mac_address(struct net_devic
+@@ -8170,6 +8217,7 @@ int dev_set_mac_address(struct net_devic
if (err)
return err;
dev->addr_assign_type = NET_ADDR_SET;
diff --git a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
index f45efdf12b..febec868f4 100644
--- a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
+++ b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int netif_rx_internal(struct sk_buff *skb);
static int call_netdevice_notifiers_info(unsigned long val,
-@@ -5931,6 +5932,11 @@ void __napi_schedule(struct napi_struct
+@@ -5937,6 +5938,11 @@ void __napi_schedule(struct napi_struct
{
unsigned long flags;
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
local_irq_save(flags);
____napi_schedule(this_cpu_ptr(&softnet_data), n);
local_irq_restore(flags);
-@@ -5982,6 +5988,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
+@@ -5988,6 +5994,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
*/
void __napi_schedule_irqoff(struct napi_struct *n)
{
@@ -119,7 +119,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!IS_ENABLED(CONFIG_PREEMPT_RT))
____napi_schedule(this_cpu_ptr(&softnet_data), n);
else
-@@ -6246,9 +6257,89 @@ static void init_gro_hash(struct napi_st
+@@ -6252,9 +6263,89 @@ static void init_gro_hash(struct napi_st
napi->gro_bitmask = 0;
}
@@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
INIT_LIST_HEAD(&napi->poll_list);
hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
napi->timer.function = napi_watchdog;
-@@ -6265,6 +6356,7 @@ void netif_napi_add(struct net_device *d
+@@ -6271,6 +6362,7 @@ void netif_napi_add(struct net_device *d
#ifdef CONFIG_NETPOLL
napi->poll_owner = -1;
#endif
@@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
set_bit(NAPI_STATE_SCHED, &napi->state);
set_bit(NAPI_STATE_NPSVC, &napi->state);
list_add_rcu(&napi->dev_list, &dev->napi_list);
-@@ -6305,6 +6397,7 @@ static void flush_gro_hash(struct napi_s
+@@ -6311,6 +6403,7 @@ static void flush_gro_hash(struct napi_s
void netif_napi_del(struct napi_struct *napi)
{
might_sleep();
@@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (napi_hash_del(napi))
synchronize_net();
list_del_init(&napi->dev_list);
-@@ -6317,50 +6410,18 @@ EXPORT_SYMBOL(netif_napi_del);
+@@ -6323,50 +6416,18 @@ EXPORT_SYMBOL(netif_napi_del);
static int napi_poll(struct napi_struct *n, struct list_head *repoll)
{
@@ -280,7 +280,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* Some drivers may have called napi_schedule
* prior to exhausting their budget.
-@@ -10340,6 +10401,10 @@ static int __init net_dev_init(void)
+@@ -10346,6 +10407,10 @@ static int __init net_dev_init(void)
sd->backlog.weight = weight_p;
}
diff --git a/target/linux/generic/pending-5.4/811-pci_disable_usb_common_quirks.patch b/target/linux/generic/pending-5.4/811-pci_disable_usb_common_quirks.patch
index 86f8a416e9..6e4584c8a1 100644
--- a/target/linux/generic/pending-5.4/811-pci_disable_usb_common_quirks.patch
+++ b/target/linux/generic/pending-5.4/811-pci_disable_usb_common_quirks.patch
@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif /* __LINUX_USB_PCI_QUIRKS_H */
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
-@@ -485,7 +485,14 @@ extern int usb_hcd_pci_probe(struct pci_
+@@ -483,7 +483,14 @@ extern int usb_hcd_pci_probe(struct pci_
extern void usb_hcd_pci_remove(struct pci_dev *dev);
extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
diff --git a/target/linux/ipq806x/patches-5.4/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch b/target/linux/ipq806x/patches-5.4/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch
index d3b39ac3e3..6d3e7d9ee0 100644
--- a/target/linux/ipq806x/patches-5.4/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch
+++ b/target/linux/ipq806x/patches-5.4/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch
@@ -33,7 +33,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -318,7 +318,7 @@ config ARCH_MULTIPLATFORM
+@@ -319,7 +319,7 @@ config ARCH_MULTIPLATFORM
depends on MMU
select ARM_HAS_SG_CHAIN
select ARM_PATCH_PHYS_VIRT
diff --git a/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
index 751ac10a19..33c77fb729 100644
--- a/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
+++ b/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
@@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
+@@ -1828,6 +1828,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
The command-line arguments provided by the boot loader will be
appended to the the device tree bootargs property.
diff --git a/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch b/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch
index 49cd68b68d..17f20f068c 100644
--- a/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch
+++ b/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1840,6 +1840,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGL
+@@ -1841,6 +1841,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGL
endchoice
diff --git a/target/linux/lantiq/patches-5.4/0025-NET-MIPS-lantiq-adds-xrx200-legacy.patch b/target/linux/lantiq/patches-5.4/0025-NET-MIPS-lantiq-adds-xrx200-legacy.patch
index 6a2143e17e..a43982f9e1 100644
--- a/target/linux/lantiq/patches-5.4/0025-NET-MIPS-lantiq-adds-xrx200-legacy.patch
+++ b/target/linux/lantiq/patches-5.4/0025-NET-MIPS-lantiq-adds-xrx200-legacy.patch
@@ -16,7 +16,7 @@ Subject: NET: MIPS: lantiq: adds xrx200 ethernet and switch driver
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
-@@ -108,7 +108,13 @@ config LANTIQ_ETOP
+@@ -109,7 +109,13 @@ config LANTIQ_ETOP
tristate "Lantiq SoC ETOP driver"
depends on SOC_TYPE_XWAY
---help---
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0014-MLK-17380-3-usb-move-EH-SINGLE_STEP_SET_FEATURE-impl.patch b/target/linux/layerscape/patches-5.4/820-usb-0014-MLK-17380-3-usb-move-EH-SINGLE_STEP_SET_FEATURE-impl.patch
index 3c05330b1a..d43626577b 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0014-MLK-17380-3-usb-move-EH-SINGLE_STEP_SET_FEATURE-impl.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0014-MLK-17380-3-usb-move-EH-SINGLE_STEP_SET_FEATURE-impl.patch
@@ -335,7 +335,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
int is_setup
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
-@@ -411,7 +411,10 @@ struct hc_driver {
+@@ -409,7 +409,10 @@ struct hc_driver {
int (*find_raw_port_number)(struct usb_hcd *, int);
/* Call for power on/off the port if necessary */
int (*port_power)(struct usb_hcd *hcd, int portnum, bool enable);
@@ -347,7 +347,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
};
static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd)
-@@ -476,6 +479,14 @@ int usb_hcd_setup_local_mem(struct usb_h
+@@ -474,6 +477,14 @@ int usb_hcd_setup_local_mem(struct usb_h
struct platform_device;
extern void usb_hcd_platform_shutdown(struct platform_device *dev);
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch
index fcad77c1eb..361328cf05 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch
@@ -42,7 +42,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
retval = xhci_enter_test_mode(xhci, test_mode, wIndex,
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
-@@ -3624,6 +3624,129 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
+@@ -3630,6 +3630,129 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
return 0;
}
@@ -174,7 +174,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
* bursts that are required to move all packets in this TD. Only SuperSpeed
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
-@@ -5385,6 +5385,7 @@ static const struct hc_driver xhci_hc_dr
+@@ -5389,6 +5389,7 @@ static const struct hc_driver xhci_hc_dr
.disable_usb3_lpm_timeout = xhci_disable_usb3_lpm_timeout,
.find_raw_port_number = xhci_find_raw_port_number,
.clear_tt_buffer_complete = xhci_clear_tt_buffer_complete,
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0017-MLK-19153-2-usb-host-xhci-do-not-return-error-status.patch b/target/linux/layerscape/patches-5.4/820-usb-0017-MLK-19153-2-usb-host-xhci-do-not-return-error-status.patch
index 637d514d76..e5394cc6d8 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0017-MLK-19153-2-usb-host-xhci-do-not-return-error-status.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0017-MLK-19153-2-usb-host-xhci-do-not-return-error-status.patch
@@ -22,7 +22,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
-@@ -2091,12 +2091,9 @@ static int process_ctrl_td(struct xhci_h
+@@ -2097,12 +2097,9 @@ static int process_ctrl_td(struct xhci_h
switch (trb_comp_code) {
case COMP_SUCCESS:
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch
index 060a809f5b..f808b5b556 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch
@@ -24,7 +24,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com>
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
-@@ -5406,6 +5406,8 @@ void xhci_init_driver(struct hc_driver *
+@@ -5410,6 +5410,8 @@ void xhci_init_driver(struct hc_driver *
drv->check_bandwidth = over->check_bandwidth;
if (over->reset_bandwidth)
drv->reset_bandwidth = over->reset_bandwidth;
diff --git a/target/linux/layerscape/patches-5.4/901-fix_irq_type_of_pca953x.patch b/target/linux/layerscape/patches-5.4/901-fix_irq_type_of_pca953x.patch
index a00a240135..5f022ac27f 100644
--- a/target/linux/layerscape/patches-5.4/901-fix_irq_type_of_pca953x.patch
+++ b/target/linux/layerscape/patches-5.4/901-fix_irq_type_of_pca953x.patch
@@ -11,7 +11,7 @@ Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
-@@ -879,10 +879,12 @@ static int pca953x_irq_setup(struct pca9
+@@ -881,10 +881,12 @@ static int pca953x_irq_setup(struct pca9
for (i = 0; i < NBANK(chip); i++)
chip->irq_stat[i] &= reg_direction[i];
mutex_init(&chip->irq_lock);
diff --git a/target/linux/mvebu/patches-5.4/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.4/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch
index fd60cdb322..b6b3247c9d 100644
--- a/target/linux/mvebu/patches-5.4/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch
+++ b/target/linux/mvebu/patches-5.4/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch
@@ -28,7 +28,7 @@ Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
+@@ -1828,6 +1828,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
The command-line arguments provided by the boot loader will be
appended to the the device tree bootargs property.
diff --git a/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch
index 8c83d55b6c..bc46f308d3 100644
--- a/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch
+++ b/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch
@@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
+@@ -1828,6 +1828,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
The command-line arguments provided by the boot loader will be
appended to the the device tree bootargs property.
diff --git a/target/linux/ramips/patches-5.4/200-add-ralink-eth.patch b/target/linux/ramips/patches-5.4/200-add-ralink-eth.patch
index b8fd8e511d..79e7c2309b 100644
--- a/target/linux/ramips/patches-5.4/200-add-ralink-eth.patch
+++ b/target/linux/ramips/patches-5.4/200-add-ralink-eth.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
-@@ -159,6 +159,7 @@ source "drivers/net/ethernet/pasemi/Kcon
+@@ -160,6 +160,7 @@ source "drivers/net/ethernet/pasemi/Kcon
source "drivers/net/ethernet/pensando/Kconfig"
source "drivers/net/ethernet/qlogic/Kconfig"
source "drivers/net/ethernet/qualcomm/Kconfig"
diff --git a/target/linux/ramips/patches-5.4/990-NET-no-auto-carrier-off-support.patch b/target/linux/ramips/patches-5.4/990-NET-no-auto-carrier-off-support.patch
index c19cfd322d..b53108ec3c 100644
--- a/target/linux/ramips/patches-5.4/990-NET-no-auto-carrier-off-support.patch
+++ b/target/linux/ramips/patches-5.4/990-NET-no-auto-carrier-off-support.patch
@@ -11,7 +11,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
-@@ -547,7 +547,10 @@ static int phy_check_link_status(struct
+@@ -549,7 +549,10 @@ static int phy_check_link_status(struct
phy_link_up(phydev);
} else if (!phydev->link && phydev->state != PHY_NOLINK) {
phydev->state = PHY_NOLINK;
@@ -23,7 +23,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
}
return 0;
-@@ -927,7 +930,10 @@ void phy_state_machine(struct work_struc
+@@ -947,7 +950,10 @@ void phy_state_machine(struct work_struc
case PHY_HALTED:
if (phydev->link) {
phydev->link = 0;
diff --git a/target/linux/realtek/patches-5.4/702-net-ethernet-add-support-for-rtl838x-ethernet.patch b/target/linux/realtek/patches-5.4/702-net-ethernet-add-support-for-rtl838x-ethernet.patch
index 11e62450d5..952384ac89 100644
--- a/target/linux/realtek/patches-5.4/702-net-ethernet-add-support-for-rtl838x-ethernet.patch
+++ b/target/linux/realtek/patches-5.4/702-net-ethernet-add-support-for-rtl838x-ethernet.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
-@@ -163,6 +163,13 @@ source "drivers/net/ethernet/rdc/Kconfig
+@@ -164,6 +164,13 @@ source "drivers/net/ethernet/rdc/Kconfig
source "drivers/net/ethernet/realtek/Kconfig"
source "drivers/net/ethernet/renesas/Kconfig"
source "drivers/net/ethernet/rocker/Kconfig"
--
2.34.1

File diff suppressed because it is too large Load Diff

View File

@ -1,72 +0,0 @@
From: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Date: Wed, 10 Feb 2021 22:53:00 +0100
Subject: mac80211: add back ath10k_pci memory hacks
These hacks have been removed in commit 1e27befe63ff ("mac80211: remove
ath10k_pci memory hacks").
However, since we still use mainline ath10k, we will need them.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
diff --git a/package/kernel/mac80211/patches/ath/960-ath10k-limit-htt-rx-ring-size.patch b/package/kernel/mac80211/patches/ath/960-ath10k-limit-htt-rx-ring-size.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e907c7ab73677a3db928ef3620d77bf22a4d752a
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath/960-ath10k-limit-htt-rx-ring-size.patch
@@ -0,0 +1,11 @@
+--- a/drivers/net/wireless/ath/ath10k/htt.h
++++ b/drivers/net/wireless/ath/ath10k/htt.h
+@@ -236,7 +236,7 @@ enum htt_rx_ring_flags {
+ };
+
+ #define HTT_RX_RING_SIZE_MIN 128
+-#define HTT_RX_RING_SIZE_MAX 2048
++#define HTT_RX_RING_SIZE_MAX 512
+ #define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
+ #define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
+ #define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)
diff --git a/package/kernel/mac80211/patches/ath/961-ath10k-limit-pci-buffer-size.patch b/package/kernel/mac80211/patches/ath/961-ath10k-limit-pci-buffer-size.patch
new file mode 100644
index 0000000000000000000000000000000000000000..b5e5c3a9bb00a407096936ece1916e331e0164f5
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath/961-ath10k-limit-pci-buffer-size.patch
@@ -0,0 +1,38 @@
+--- a/drivers/net/wireless/ath/ath10k/pci.c
++++ b/drivers/net/wireless/ath/ath10k/pci.c
+@@ -131,7 +131,7 @@ static const struct ce_attr pci_host_ce_
+ .flags = CE_ATTR_FLAGS,
+ .src_nentries = 0,
+ .src_sz_max = 2048,
+- .dest_nentries = 512,
++ .dest_nentries = 128,
+ .recv_cb = ath10k_pci_htt_htc_rx_cb,
+ },
+
+@@ -140,7 +140,7 @@ static const struct ce_attr pci_host_ce_
+ .flags = CE_ATTR_FLAGS,
+ .src_nentries = 0,
+ .src_sz_max = 2048,
+- .dest_nentries = 128,
++ .dest_nentries = 64,
+ .recv_cb = ath10k_pci_htc_rx_cb,
+ },
+
+@@ -167,7 +167,7 @@ static const struct ce_attr pci_host_ce_
+ .flags = CE_ATTR_FLAGS,
+ .src_nentries = 0,
+ .src_sz_max = 512,
+- .dest_nentries = 512,
++ .dest_nentries = 128,
+ .recv_cb = ath10k_pci_htt_rx_cb,
+ },
+
+@@ -192,7 +192,7 @@ static const struct ce_attr pci_host_ce_
+ .flags = CE_ATTR_FLAGS,
+ .src_nentries = 0,
+ .src_sz_max = 2048,
+- .dest_nentries = 128,
++ .dest_nentries = 96,
+ .recv_cb = ath10k_pci_pktlog_rx_cb,
+ },
+

View File

@ -1,19 +0,0 @@
From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= <fabian@blaese.de>
Date: Sat, 23 Oct 2021 23:34:07 +0200
Subject: [PATCH] mt7621: retain old compat_version
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index a3bc14d59d..99887e8192 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -91,8 +91,7 @@ define Build/zytrx-header
endef
define Device/dsa-migration
- DEVICE_COMPAT_VERSION := 1.1
- DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
+ DEVICE_COMPAT_VERSION := 1.0
endef
define Device/adslr_g7

View File

@ -0,0 +1,32 @@
From f53b71d2907eeb0d80e79d99fa7b756b5e5bf32b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= <fabian@blaese.de>
Date: Thu, 24 Feb 2022 00:04:47 +0100
Subject: [PATCH] Add hack which fixes forwarding on a stacked bridge
configuration using DSA
---
.../hack-5.4/999-fix-stacked-bridge-forwarding.patch | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 target/linux/generic/hack-5.4/999-fix-stacked-bridge-forwarding.patch
diff --git a/target/linux/generic/hack-5.4/999-fix-stacked-bridge-forwarding.patch b/target/linux/generic/hack-5.4/999-fix-stacked-bridge-forwarding.patch
new file mode 100644
index 0000000000..e1d4cb9cd5
--- /dev/null
+++ b/target/linux/generic/hack-5.4/999-fix-stacked-bridge-forwarding.patch
@@ -0,0 +1,12 @@
+--- a/net/bridge/br_input.c
++++ b/net/bridge/br_input.c
+@@ -52,6 +52,9 @@ static int br_pass_frame_up(struct sk_bu
+ return NET_RX_DROP;
+ }
+
++ /* remove offload flag, so upper bridges do not drop the packet */
++ br_switchdev_frame_unmark(skb);
++
+ indev = skb->dev;
+ skb->dev = brdev;
+ skb = br_handle_vlan(br, NULL, vg, skb);
--
2.35.1

View File

@ -7,9 +7,9 @@ set -o pipefail
builddir=./build
# OpenWrt: package hashes correspond to core repo version
OPENWRTREV="v21.02.1"
PACKAGEREV="ded142471e36831d2af63c7fe5062c4367f8ccd2"
ROUTINGREV="9e7698f20d1edf8f912fbce2f21400f3cc772b31"
OPENWRTREV="v21.02.2"
PACKAGEREV="b0ccc356900f6e1e1dc613d0ea980d5572f553dd"
ROUTINGREV="10d3ffd8b30186b49538167bac1fa1bf9c88f860"
# Gluon packages: master from 2020-02-04
GLUONREV="12e41d0ff07ec54bbd67a31ab50d12ca04f2238c"
@ -290,7 +290,8 @@ cp_firmware() {
filename_build=${f##*/}
filename_build=${filename_build//openwrt/fff-${version}}
filename_build=${filename_build//squashfs-/}
filename_build=${filename_build//${chipset}-${subtarget}-/}
filename_build=${filename_build//${chipset}-/}
filename_build=${filename_build//${subtarget}-/}
cp "$f" "$imagedestpath/$filename_build"
done
done

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-alfred-monitoring-proxy
PKG_RELEASE:=5
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-alfred
PKG_RELEASE:=2
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-babeld
PKG_RELEASE:=8
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -38,10 +38,18 @@ babel_add_peeraddr() {
uci add_list "$option"="$peer_ip"
elif router_ip=$(uci -q get gateway.meta.router_ip); then
# use router_ip if no peer_ip is set
uci add_list "$option"="$router_ip"
ip=$router_ip
# use only first ip
ip=${ip%% *}
# remove CIDR mask
ip=${ip%%/*}
uci add_list "$option"="$ip"
elif ipaddr=$(uci -q get gateway.@client[0].ipaddr); then
# use client interface address (without subnet) if no router_ip is set
uci add_list "$option"=$(echo $ipaddr | cut -d / -f1)
uci add_list "$option"=${ipaddr%%/*}
else
echo "WARNING: No peer_ip, router_ip or client interface ipaddr set! IPv4 routing is not possible."
return 1

View File

@ -0,0 +1,37 @@
#!/bin/sh
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
. /usr/share/libubox/jshn.sh
json_load_file $SCRIPT_DATA_FILE
json_select babel
json_add_array "neighbours"
if pgrep babeld >/dev/null; then
neighbours="$(echo dump | nc ::1 33123 | grep '^add neighbour' |
awk '{
for (i=2; i < NF; i += 2) {
vars[$i] = $(i+1)
}
}
{
printf "%s;%s;%s;>", vars["address"], vars["if"], vars["cost"]
}')"
IFS='>'; set $neighbours; IFS=$' \t\n'
for a; do
json_add_object
json_add_string "ip" "$(echo $a | awk '{split($0, b, ";"); printf b[1]}')"
json_add_string "outgoing_interface" "$(echo $a | awk '{split($0, b, ";"); printf b[2]}')"
json_add_string "link_cost" "$(echo $a | awk '{split($0, b, ";"); printf b[3]}')"
json_close_object #this_neighbour
done
fi
json_close_object #neighbours
json_dump > $SCRIPT_DATA_FILE
#exit 0

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-batman-adv
PKG_RELEASE:=4
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-boardname
PKG_RELEASE:=8
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-config
PKG_RELEASE:=2
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -0,0 +1 @@
vm.panic_on_oom=1

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-dhcp
PKG_RELEASE:=6
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,3 +1,10 @@
# Use a larger cachesize by default
cachesize=1024
# Increase cachesize for systems with enough memory
mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
[ "$mem" -gt 65536 ] && cachesize=8192
uci batch >/dev/null <<EOF
delete dhcp.@dnsmasq[0]
delete dhcp.lan
@ -12,6 +19,7 @@ uci batch >/dev/null <<EOF
set dhcp.@dnsmasq[-1].domain='fff.community'
set dhcp.@dnsmasq[-1].expandhosts='0'
set dhcp.@dnsmasq[-1].nonegcache='0'
set dhcp.@dnsmasq[-1].cachesize="$cachesize"
set dhcp.@dnsmasq[-1].authoritative='1'
set dhcp.@dnsmasq[-1].readethers='1'
set dhcp.@dnsmasq[-1].leasefile='/tmp/dhcp.leases'

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-fastd
PKG_RELEASE:=3
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -29,6 +29,7 @@ ln -s /tmp/fastd_fff_peers /etc/fastd/fff/peers
echo "#!/bin/sh" > /etc/fastd/fff/up.sh
echo "ip link set up dev fffVPN" >> /etc/fastd/fff/up.sh
echo "batctl if add fffVPN" >> /etc/fastd/fff/up.sh
echo "batctl hardif fffVPN hop_penalty 30" >> /etc/fastd/fff/up.sh
chmod +x /etc/fastd/fff/up.sh
exit 0

View File

@ -0,0 +1,34 @@
protocol=fastd
fastd_clear() {
rm /tmp/fastd_fff_peers/*
}
fastd_addpeer() {
[ -d /tmp/fastd_fff_peers ] || mkdir /tmp/fastd_fff_peers
# write fastd-config
json_get_var servername name
filename="/etc/fastd/fff/peers/$servername"
echo "#name \"${servername}\";" > "$filename"
json_get_var key key
echo "key \"${key}\";" >> "$filename"
json_get_var address address
json_get_var port port
echo "remote \"${address}\" port ${port};" >> "$filename"
echo "" >> "$filename"
echo "float yes;" >> "$filename"
}
fastd_start_stop() {
/etc/init.d/fastd reload # does nothing if fastd was not running
# fastd start/stop for various situations
# this is needed for first start and if fastd comes up or disappears in hoodfile
pidfile="/tmp/run/fastd.fff.pid"
if [ "$(ls /etc/fastd/fff/peers/* 2>/dev/null)" ]; then
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) || /etc/init.d/fastd start
else
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) && /etc/init.d/fastd stop
fi
}

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-firewall
PKG_RELEASE:=8
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,2 +0,0 @@
#solves MTU problem with bad ISPs
iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

View File

@ -1,5 +0,0 @@
# Limit ssh to 6 new connections per 60 seconds
/usr/sbin/ip6tables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -m recent --set --name dropbear
/usr/sbin/ip6tables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -m recent --update --seconds 60 --hitcount 6 --rttl --name dropbear -j DROP
/usr/sbin/iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -m recent --set --name dropbear
/usr/sbin/iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -m recent --update --seconds 60 --hitcount 6 --rttl --name dropbear -j DROP

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-hoods
PKG_RELEASE:=19
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-hoodutils
PKG_RELEASE:=2
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-layer3-config
PKG_RELEASE:=9
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -20,7 +20,7 @@ configure() {
# ip6addr
#remove old ip6addr
for ip in $(uci get network.client.ip6addr); do
for ip in $(uci -q get network.client.ip6addr); do
if echo "$ip" | grep -v -e "fdff:" -e "fe80::1/64" > /dev/null; then
uci del_list network.client.ip6addr="$ip"
fi
@ -50,11 +50,10 @@ configure() {
# set interface
#remove all eth interfaces
ifaces=$(uci get network.client.ifname | sed 's/\beth[^ ]* *//g' | sed 's/\bswitch[^ ]* *//g')
if vlan=$(uci -q get gateway.@client[0].vlan); then
uci set network.client.ifname="${SWITCHDEV}.$vlan $ifaces"
uci set network.client.ifname="${SWITCHDEV}.$vlan"
elif iface=$(uci -q get gateway.@client[0].iface); then
uci set network.client.ifname="$iface $ifaces"
uci set network.client.ifname="$iface"
else
echo "WARNING: No Interface for client specified"
fi

View File

@ -0,0 +1,31 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-layer3-snat
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk
define Package/fff-layer3-snat
SECTION:=base
CATEGORY:=Freifunk
TITLE:=Freifunk-Franken layer3 configuration with SNAT
URL:=https://www.freifunk-franken.de
DEPENDS:= \
+fff-firewall \
+fff-layer3-config \
+kmod-ipt-nat
endef
define Package/fff-layer3-snat/description
With this package it is possible to make SNAT with IPv4 on the router
endef
define Build/Compile
# nothing
endef
define Package/fff-layer3-snat/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,fff-layer3-snat))

View File

@ -0,0 +1,34 @@
configure() {
# first we delete the snat config
uci -q del network.client.fff_snat
uci -q del network.client.fff_snat_sourceip
if [ "$(uci -q get gateway.@client[0].snat)" = '1' ]; then
# first check the config is plausible
if ! routerip=$(uci -q get gateway.meta.router_ip); then
echo "ERROR: No router_ip set, which is required for SNAT!"
return 1
fi
if ! uci -q get gateway.@client[0].ipaddr >/dev/null; then
echo "ERROR: No ipaddr set, which is required for SNAT!"
return 1
fi
# keep only the first IP
routerip=${routerip%% *}
# keep only the IP without the CIDR
routerip=${routerip%%/*}
# We set the snat config
uci set network.client.fff_snat=1
uci set network.client.fff_snat_sourceip=$routerip
fi
}
apply() {
uci commit network
}
revert() {
uci revert network
}

View File

@ -0,0 +1,4 @@
if [ "$(uci -q get network.client.fff_snat)" = '1' ]; then
iptables -t mangle -A PREROUTING -i br-client -j MARK --set-mark 0x736e6174
iptables -t nat -A POSTROUTING -m mark --mark 0x736e6174 -j SNAT --to-source $(uci -q get network.client.fff_snat_sourceip)
fi

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-layer3
PKG_RELEASE:=9
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk
@ -15,6 +15,7 @@ define Package/fff-layer3
+fff-boardname \
+fff-dhcp \
+fff-layer3-config \
+fff-layer3-snat \
+fff-mqtt-monitoring \
+fff-network \
+fff-ra \
@ -36,6 +37,7 @@ define Package/fff-layer3
+iptables-mod-ipopt \
+iptables-mod-conntrack-extra \
+mtr \
+snmp-utils \
+tc \
+tcpdump \
+vxlan

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-mqtt-monitoring
PKG_RELEASE:=1
PKG_RELEASE:=$(COMMITCOUNT)
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-mqtt-monitoring

View File

@ -0,0 +1 @@
*/5 * * * * sleep $(/usr/bin/random 70 85); /usr/sbin/json-mqtt-proxy

View File

@ -0,0 +1,7 @@
#!/bin/sh
MACADDR=$(/bin/sed 's/://g' < /sys/class/net/br-client/address)
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
if [ -n "$(uci -q get fff.mqtt.server)" ] ; then
mosquitto_pub -h "$(uci get fff.mqtt.server)" -p 1883 -t /monitoring/v2/"$MACADDR" -f "$SCRIPT_DATA_FILE"
fi

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-mqtt
PKG_RELEASE:=2
PKG_RELEASE:=$(COMMITCOUNT)
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-mqtt

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-network
PKG_RELEASE:=50
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,30 +0,0 @@
config globals 'globals'
option packet_steering '1'
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'client'
option type 'bridge'
option auto '1'
config interface 'wan'
option proto 'none'
option ifname 'eth2'
config interface 'wan4'
option proto 'dhcp'
option ifname '@wan'
config interface 'wan6'
option proto 'dhcpv6'
option reqprefix 'no'
option sourcefilter '0'
option ifname '@wan'
config interface 'ethmesh'
option proto 'batadv_hardif'
option master 'bat0'

View File

@ -0,0 +1,141 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
. /lib/functions/system.sh
. /lib/functions/fff/network
BOARD="$(uci get board.model.name)"
. /etc/network.$BOARD
[ -n "$ROUTERMAC" ] || ROUTERMAC=$(get_mac_label)
# Clear possibly existing network configuration
> /etc/config/network
# Add basic network configuration
uci batch <<-__EOF__
set network.loopback='interface'
set network.loopback.ifname='lo'
set network.loopback.proto='static'
set network.loopback.ipaddr='127.0.0.1'
set network.loopback.netmask='255.0.0.0'
set network.client='interface'
set network.client.type='bridge'
set network.client.auto='1'
set network.wan='interface'
set network.wan.proto='none'
set network.wan.ifname="$WANDEV"
set network.wan4='interface'
set network.wan4.proto='dhcp'
set network.wan4.ifname='@wan'
set network.wan6='interface'
set network.wan6.proto='dhcpv6'
set network.wan6.reqprefix='no'
set network.wan6.sourcefilter='0'
set network.wan6.ifname='@wan'
set network.ethmesh='interface'
set network.ethmesh.proto='batadv_hardif'
set network.ethmesh.master='bat0'
__EOF__
SWITCHHW=$(swconfig list | awk '{ print $4 }')
if [ "$DSA" = "1" ]; then
uci batch <<-__EOF__
set network.$SWITCHDEV=device
set network.$SWITCHDEV.name=$SWITCHDEV
set network.$SWITCHDEV.type=bridge
# temporary workaround for netifd bug present in OpenWrt 21.02.0 (FS#4104)
set network.$SWITCHDEV.bridge_empty='1'
set network.${SWITCHDEV}_1=bridge-vlan
set network.${SWITCHDEV}_1.device=$SWITCHDEV
set network.${SWITCHDEV}_1.vlan=1
set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS"
set network.${SWITCHDEV}_3=bridge-vlan
set network.${SWITCHDEV}_3.device=$SWITCHDEV
set network.${SWITCHDEV}_3.vlan=3
set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"
__EOF__
if [ "$WANDEV" = "$SWITCHDEV" ] || ! [ -z "$WAN_PORTS" ]; then
uci batch <<-__EOF__
set network.${SWITCHDEV}_2=bridge-vlan
set network.${SWITCHDEV}_2.device=$SWITCHDEV
set network.${SWITCHDEV}_2.vlan=2
set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
__EOF__
fi
elif [ -n "$SWITCHHW" ]; then
uci batch <<-__EOF__
set network.$SWITCHDEV=switch
set network.$SWITCHDEV.name=$SWITCHHW
set network.$SWITCHDEV.enable=1
set network.$SWITCHDEV.reset=1
set network.$SWITCHDEV.enable_vlan=1
set network.${SWITCHDEV}_1=switch_vlan
set network.${SWITCHDEV}_1.device=$SWITCHHW
set network.${SWITCHDEV}_1.vlan=1
set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS"
set network.${SWITCHDEV}_3=switch_vlan
set network.${SWITCHDEV}_3.device=$SWITCHHW
set network.${SWITCHDEV}_3.vlan=3
set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"
__EOF__
if [ "$WANDEV" = "$SWITCHDEV" ] || [ -n "$WAN_PORTS" ]; then
uci batch <<-__EOF__
set network.${SWITCHDEV}_2=switch_vlan
set network.${SWITCHDEV}_2.device=$SWITCHHW
set network.${SWITCHDEV}_2.vlan=2
set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
__EOF__
fi
fi
if [ -n "$SWITCHHW" ] || [ "$DSA" = "1" ]; then
uci set network.client.ifname="$SWITCHDEV.1 bat0"
uci set network.ethmesh.ifname="$SWITCHDEV.3"
if [ "$WANDEV" = "$SWITCHDEV" ]; then
uci set network.wan.ifname=$WANDEV.2
fi
fi
if [ -n "$ETHMESHMAC" ]; then
uci set network.ethmesh.macaddr=$ETHMESHMAC
fi
if [ -n "$ROUTERMAC" ]; then
uci set network.client.macaddr=$ROUTERMAC
fi
prefix="fdff::/64"
# Set $prefix::1 as IP
addr1=$(owipcalc "$prefix" add ::1)
# Set $prefix::MAC as IP
addr2=$(owipcalc "$prefix" add "::$(ipMacSuffix "$ROUTERMAC")")
# Set $prefix::EUI64 as IP
addr3=$(owipcalc "$prefix" add "::$(ipEUISuffix "$ROUTERMAC")")
uci batch <<-__EOF__
del network.globals
set network.globals=globals
set network.globals.ula_prefix=$prefix
add_list network.client.ip6addr=$addr1
add_list network.client.ip6addr=$addr2
add_list network.client.ip6addr=$addr3
set network.client.proto=static
__EOF__
uci -q commit network

View File

@ -0,0 +1,10 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
# Enable RPS
uci batch <<-__EOF__
set network.globals=globals
set network.globals.packet_steering='1'
__EOF__
uci -q commit network

View File

@ -0,0 +1,100 @@
#!/bin/sh
IFACEBLACKLIST=$(uci get nodewatcher.@network[0].iface_blacklist)
IPWHITELIST=$(uci get nodewatcher.@network[0].ip_whitelist)
debug() {
(>&2 echo "nodewatcher: $1")
}
inArray() {
local value
for value in $1; do
[ "$value" = "$2" ] && return 0
done
return 1
}
debug "Collecting information from network interfaces"
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
. /usr/share/libubox/jshn.sh
json_load_file $SCRIPT_DATA_FILE
json_add_array "interfaces"
# Loop through interfaces: for entry in $IFACES; do
for filename in $(grep 'up\|unknown' /sys/class/net/*/operstate); do
ifpath=${filename%/operstate*}
iface=${ifpath#/sys/class/net/}
inArray "$IFACEBLACKLIST" "$iface" && continue
json_add_object ""
json_add_string "name" "$iface"
#Get interface data for whitelisted interfaces
# shellcheck disable=SC2016
mac_addr=$(ip addr show dev $iface | awk '/ether/ { printf $2 }')
json_add_string "mac_addr" "$mac_addr"
mtu=$(ip addr show dev $iface | awk '/mtu/ { printf $5 }')
json_add_string "mtu" "$mtu"
if inArray "$IPWHITELIST" "$iface"; then
# shellcheck disable=SC2016
json_add_array ipv4_addr
IN=$(ip addr show dev $iface | awk '/inet / { split($2, a, "/"); printf a[1]";" }')
IFS=';'; set $IN; IFS=$' \t\n'
for a; do json_add_string "" "$a"; done
json_close_object #ipv4_addr
json_add_array ipv6_addr
IN=$(ip addr show dev $iface | awk '/inet6/ && /scope global/ { printf $2";" }')
IFS=';'; set $IN; IFS=$' \t\n'
for a; do json_add_string "" "$a"; done
json_close_object #ipv6_addr
json_add_array ipv6_link_local_addr
IN=$(ip addr show dev $iface | awk '/inet6/ && /scope link/ { printf $2 }')
IFS=';'; set $IN; IFS=$' \t\n'
for a; do json_add_string "" "$a"; done
json_close_object #ipv6_link_local_addr
fi
json_add_object "traffic"
traffic_rx=$(cat "$ifpath/statistics/rx_bytes")
json_add_string "rx" "$(cat "$ifpath/statistics/rx_bytes")"
traffic_tx=$(cat "$ifpath/statistics/tx_bytes")
json_add_string "tx" "$traffic_tx"
json_close_object #traffic
wlan_mode=$(iwconfig $iface 2>/dev/null | awk -F':' '/Mode/{ split($2, m, " "); printf m[1] }')
if [[ $wlan_mode ]]; then
json_add_object "wlan"
wlan_cell=$(iwconfig $iface 2>/dev/null | awk -F':' '/Cell/{ split($0, c, " "); printf c[5] }')
wlan_essid=$(iwconfig $iface 2>/dev/null | awk -F':' '/ESSID/ { split($0, e, "\""); printf e[2] }')
wlan_frequency=$(iwconfig $iface 2>/dev/null | awk -F':' '/Freq/{ split($3, f, " "); printf f[1]f[2] }')
wlan_tx_power=$(iwconfig $iface 2>/dev/null | awk -F':' '/Tx-Power/{ split($0, p, "="); sub(/[[:space:]]*$/, "", p[2]); printf p[2] }')
wlan_ssid=$(iw dev $iface info 2>/dev/null | awk '/ssid/{ split($0, s, " "); printf s[2]}')
wlan_type=$(iw dev $iface info 2>/dev/null | awk '/type/ { split($0, t, " "); printf t[2]}')
wlan_channel=$(iw dev $iface info 2>/dev/null | awk '/channel/{ split($0, c, " "); printf c[2]}')
wlan_width=$(iw dev $iface info 2>/dev/null | awk '/width/{ split($0, w, ": "); sub(/ .*/, "", w[2]); printf w[2]}')
[[ $wlan_mode ]] && json_add_string "mode" "$wlan_mode"
[[ $wlan_cell ]] && json_add_string "cell" "$wlan_cell"
[[ $wlan_essid ]] && json_add_string "essid" "$wlan_essid"
[[ $wlan_frequency ]] && json_add_string "frequency" "$wlan_frequency"
[[ "$wlan_tx_power" ]] && json_add_string "tx_power" "$wlan_tx_power"
[[ $wlan_ssid ]] && json_add_string "ssid" "$wlan_ssid"
[[ $wlan_type ]] && json_add_string "type" "$wlan_type"
[[ $wlan_channel ]] && json_add_string "channel" "$wlan_channel"
[[ $wlan_width ]] && json_add_string "width" "$wlan_width"
json_close_object #wlan
fi
json_close_object #iface object
done
json_dump > $SCRIPT_DATA_FILE
#exit 0

View File

@ -0,0 +1,36 @@
#!/bin/sh
MESH_INTERFACE=$(uci get nodewatcher.@network[0].mesh_interface)
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
debug() {
(>&2 echo "nodewatcher: $1")
}
debug "Collecting information about connected clients"
. /usr/share/libubox/jshn.sh
json_load_file $SCRIPT_DATA_FILE
json_add_object "clients"
json_add_array interfaces
client_count=0
CLIENT_INTERFACES=$(ls "/sys/class/net/$MESH_INTERFACE/brif" | grep -v '^bat')
for clientif in ${CLIENT_INTERFACES}; do
json_add_object ""
cc=$(bridge fdb show br "$MESH_INTERFACE" brport "$clientif" | grep -v self | grep -v permanent -c)
client_count=$((client_count + cc))
json_add_string "$clientif" "$cc"
json_close_object #iface object
done
json_close_object #interfaces array
json_add_string "count" "$client_count"
json_close_object #clients
json_dump > $SCRIPT_DATA_FILE
#exit 0

View File

@ -6,7 +6,6 @@
BOARD="$(uci get board.model.name)"
. /etc/network.$BOARD
[ -n "$ROUTERMAC" ] || ROUTERMAC=$(get_mac_label)
if [ -s /etc/network.config ] ; then
. /etc/network.config
@ -105,109 +104,6 @@ elif [ "$TWO_PORT" = "YES" ]; then
uci commit network
fi
else
if ! uci -q get network.$SWITCHDEV > /dev/null ; then
if [ "$DSA" = "1" ]; then
uci set network.$SWITCHDEV=device
uci set network.$SWITCHDEV.name=$SWITCHDEV
uci set network.$SWITCHDEV.type=bridge
# temporary workaround for netifd bug present in OpenWrt 21.02.0 (FS#4104)
uci set network.$SWITCHDEV.bridge_empty='1'
uci set network.${SWITCHDEV}_1=bridge-vlan
uci set network.${SWITCHDEV}_1.device=$SWITCHDEV
uci set network.${SWITCHDEV}_1.vlan=1
uci set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS"
if [ "$WANDEV" = "$SWITCHDEV" ] || ! [ -z "$WAN_PORTS" ]; then
uci set network.${SWITCHDEV}_2=bridge-vlan
uci set network.${SWITCHDEV}_2.device=$SWITCHDEV
uci set network.${SWITCHDEV}_2.vlan=2
uci set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
fi
uci set network.${SWITCHDEV}_3=bridge-vlan
uci set network.${SWITCHDEV}_3.device=$SWITCHDEV
uci set network.${SWITCHDEV}_3.vlan=3
uci set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"
else
SWITCHHW=$(swconfig list | awk '{ print $4 }')
uci set network.$SWITCHDEV=switch
uci set network.$SWITCHDEV.name=$SWITCHHW
uci set network.$SWITCHDEV.enable=1
uci set network.$SWITCHDEV.reset=1
uci set network.$SWITCHDEV.enable_vlan=1
uci set network.${SWITCHDEV}_1=switch_vlan
uci set network.${SWITCHDEV}_1.device=$SWITCHHW
uci set network.${SWITCHDEV}_1.vlan=1
uci set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS"
if [ "$WANDEV" = "$SWITCHDEV" ] || [ -n "$WAN_PORTS" ]; then
uci set network.${SWITCHDEV}_2=switch_vlan
uci set network.${SWITCHDEV}_2.device=$SWITCHHW
uci set network.${SWITCHDEV}_2.vlan=2
uci set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
fi
uci set network.${SWITCHDEV}_3=switch_vlan
uci set network.${SWITCHDEV}_3.device=$SWITCHHW
uci set network.${SWITCHDEV}_3.vlan=3
uci set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"
fi
uci set network.client.ifname="$SWITCHDEV.1 bat0"
uci set network.ethmesh.ifname="$SWITCHDEV.3"
if [ "$WANDEV" = "$SWITCHDEV" ]; then
uci set network.wan.ifname=$WANDEV.2
else
uci set network.wan.ifname=$WANDEV
fi
uci commit network
fi
fi
/etc/init.d/network restart
if [ -n "$ETHMESHMAC" ]; then
if uci get network.ethmesh.macaddr
then
echo "MAC for ethmesh is set already"
else
echo "Fixing MAC on $SWITCHDEV.3 (ethmesh)"
sleep 10
uci set network.ethmesh.macaddr=$ETHMESHMAC
uci commit network
ifconfig $SWITCHDEV.3 down
ifconfig $SWITCHDEV.3 hw ether $ETHMESHMAC
ifconfig $SWITCHDEV.3 up
/etc/init.d/network restart
fi
fi
if [ -n "$ROUTERMAC" ]; then
if uci get network.client.macaddr
then
echo "MAC for client is set already"
else
echo "Fixing MAC on br-client"
sleep 10
uci set network.client.macaddr=$ROUTERMAC
uci commit network
ifconfig br-client down
ifconfig br-client hw ether $ROUTERMAC
ifconfig br-client up
/etc/init.d/network restart
fi
fi
if [ -n "$ETH0MAC" ]; then
@ -216,44 +112,6 @@ if [ -n "$ETH0MAC" ]; then
NEW_MACADDR=$(cat "/sys/class/net/${ETH0MAC}/address")
uci set network.$ETH0DEV.macaddr=$NEW_MACADDR
uci commit network
ifconfig $ETH0DEV down
ifconfig $ETH0DEV hw ether $NEW_MACADDR
ifconfig $ETH0DEV up
/etc/init.d/network restart
fi
if uci -q get "network.client.ip6addr" > /dev/null
then
echo "IPv6 for client is set already"
else
echo "Setting IPv6 addresses"
# Some time needed :(
sleep 5
for ip in $(ip -6 addr show br-client | awk '/fdff/{ print $2 }'); do
ip -6 addr del $ip dev br-client
done
prefix="fdff::/64"
# Set $prefix::MAC as IP
addr=$(owipcalc "$prefix" add "::$(ipMacSuffix "$ROUTERMAC")")
ip -6 addr add $addr dev br-client
uci -q set network.globals.ula_prefix=$prefix
uci -q add_list network.client.ip6addr=$addr
uci -q set network.client.proto=static
# Set $prefix::1 as IP
addr=$(owipcalc "$prefix" add ::1)
ip -6 addr add $addr dev br-client
uci -q add_list network.client.ip6addr=$addr
# Set $prefix::link-local as IP
addr=$(owipcalc "$prefix" add "::$(ipEUISuffix "$ROUTERMAC")")
ip -6 addr add $addr dev br-client
uci -q add_list network.client.ip6addr=$addr
uci -q commit network
[ -s /etc/init.d/fff-uradvd ] && /etc/init.d/fff-uradvd restart
fi
reload_config

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-node
PKG_RELEASE:=3
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk
@ -12,6 +12,7 @@ define Package/fff-node
URL:=https://www.freifunk-franken.de
DEPENDS:=+fff-batman-adv \
+fff-fastd \
+fff-vxlan-node-vpn \
+fff-firewall \
+fff-hoods \
+fff-uradvd

View File

@ -0,0 +1 @@
*/5 * * * * sleep $(/usr/bin/random 0 29); /usr/sbin/nodewatcher-json

View File

@ -0,0 +1,145 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
json_init
SCRIPT_STATUS_FILE=$(uci get nodewatcher.@script[0].status_text_file)
SCRIPT_VERSION=$(cat /etc/nodewatcher_version)
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
debug() {
(>&2 echo "nodewatcher: $1")
}
debug "Collecting basic system status data"
json_add_object "system"
json_add_string "status" "online"
hostname="$(cat /proc/sys/kernel/hostname)"
mac=$(awk '{ mac=toupper($1); gsub(":", "", mac); print mac }' /sys/class/net/br-client/address 2>/dev/null)
[ "$hostname" = "OpenWrt" ] && hostname="$mac"
[ "$hostname" = "FFF" ] && hostname="$mac"
json_add_string "hostname" "$hostname"
description="$(uci -q get fff.system.description)"
[ -n "$description" ] && json_add_string "description" "$description"
latitude="$(uci -q get fff.system.latitude)"
longitude="$(uci -q get fff.system.longitude)"
if [ -n "$longitude" -a -n "$latitude" ]; then
json_add_object "geo"
json_add_string "lat" "$latitude"
json_add_string "lng" "$longitude"
json_close_object #geo
fi
position_comment="$(uci -q get fff.system.position_comment)"
[ -n "$position_comment" ] && json_add_string "position_comment" "$position_comment"
contact="$(uci -q get fff.system.contact)"
[ -n "$contact" ] && json_add_string "contact" "$contact"
json_add_string "uptime" $(awk '{ printf $1 }' /proc/uptime)
json_add_string "idletime" $(awk '{ printf $2 }' /proc/uptime)
# Add Memory
json_add_object "memory"
json_add_string "total" $(awk '/^MemTotal/ { printf $2 }' /proc/meminfo)
json_add_string "available" $(awk '/^MemAvail/ { printf $2 }' /proc/meminfo)
json_add_string "caching" $(awk '/^Cached/ { printf $2 }' /proc/meminfo)
json_add_string "buffering" $(awk '/^Buffers/ { printf $2 }' /proc/meminfo)
json_add_string "free" $(awk '/^MemFree/ { printf $2 }' /proc/meminfo)
json_close_object #memory
# Add CPU
json_add_array cpu
IN=$(awk -F': ' ' /model/ { printf $2";" }' /proc/cpuinfo)
IFS=';'; set $IN; IFS=$' \t\n'
for a; do json_add_string "" "$a"; done
json_close_object #cpu
# Add Chipset
IN=$(awk -F': ' ' /system type/ { printf $2";" }' /proc/cpuinfo)
IFS=';'; set $IN; IFS=$' \t\n'
for a; do json_add_string "chipset" "$a"; done
IN=$(awk -F': ' ' /platform/ { printf $2";" }' /proc/cpuinfo)
IFS=';'; set $IN; IFS=$' \t\n'
for a; do json_add_string "chipset" "$a"; done
model=$(cat /var/sysinfo/model)
[ -n "$model" ] && json_add_string "model" "$model"
local_time=$(date +%s)
[ -n "$local_time" ] && json_add_string "local_time" "$local_time"
loadavg=$(awk '{ printf $3 }' /proc/loadavg)
[ -n "$loadavg" ] && json_add_string "loadavg" "$loadavg"
processes=$(awk '{ printf $4 }' /proc/loadavg)
[ -n "$processes" ] && json_add_string "processes" "$processes"
debug "Collecting version information"
json_close_object #system
if [ -e /sys/module/batman_adv/version ]; then
batman_advanced_version=$(cat /sys/module/batman_adv/version)
json_add_object "batman_advanced"
json_add_string "version" "$batman_advanced_version"
json_close_object #batman_advanced
fi
json_select system
json_add_string "kernel_version" "$(uname -r)"
json_add_string "nodewatcher_version" "$SCRIPT_VERSION"
if [ -x /usr/bin/fastd ]; then
json_add_string "fastd_version" "$(/usr/bin/fastd -v | awk '{ print $2 }')"
fi
json_close_object #system
if [ -x /usr/sbin/babeld ]; then
json_add_object "babel"
json_add_string "version" "$(/usr/sbin/babeld -V 2>&1)"
json_close_object #babel
fi
json_select system
json_add_object "dist"
. /etc/openwrt_release
json_add_string "name" "$DISTRIB_ID"
json_add_string "version" "$DISTRIB_RELEASE"
json_close_object #dist
json_add_object "firmware"
. /etc/firmware_release
json_add_string "version" "$FIRMWARE_VERSION"
json_add_string "revision" "$BUILD_DATE"
json_add_object "openwrt"
json_add_string "core_revision" "$OPENWRT_CORE_REVISION"
json_add_string "feeds_packages_revision" "$OPENWRT_FEEDS_PACKAGES_REVISION"
json_close_object #openwrt
json_close_object #firmware
debug "Collecting hood information and additional status data"
json_add_object "hood"
hoodname="$(uci -q get "system.@system[0].hood")"
[ -n "$hoodname" ] && json_add_string "name" "$hoodname"
hoodid="$(uci -q get "system.@system[0].hoodid")"
[ -n "$hoodid" ] && json_add_string "id" "$hoodid"
json_close_object #hood
if [ -s "$SCRIPT_STATUS_FILE" ]; then
status_text="$(cat "$SCRIPT_STATUS_FILE")"
json_add_string "status_text" "$status_text"
fi
# Checks if fastd is running
vpn_active=0
pidof fastd >/dev/null && vpn_active=1
json_add_string "vpn_active" "$vpn_active"
json_dump > $SCRIPT_DATA_FILE
#exit 0

View File

@ -0,0 +1,45 @@
#!/bin/sh
test -f /tmp/started || exit
# Allow only one instance
lockfile="/var/lock/${0##*/}.json.lock"
if ! lock -n "$lockfile"; then
echo "Only one instance of $0 allowed."
exit 1
fi
trap "lock -u \"$lockfile\"" INT TERM EXIT
[ -s /etc/config/nodewatcher ] || exit 1
[ "$(uci get nodewatcher.@script[0].disabled)" = "1" ] && exit 0
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
debug() {
(>&2 echo "nodewatcher: $1")
}
#This method generates the crawl data JSON file that is being fetched by netmon
#and provided by a small local httpd
crawl() {
debug "Putting all information into a JSON-File and save it at $SCRIPT_DATA_FILE"
for f in /usr/lib/nodewatcher-json.d/*.sh; do
tmp="$($f)"
if [ $? -ne 0 ]; then
debug "Error when executing subscript $f, exiting!"
exit 1
fi
done
SCRIPT_DATA_DIR=$(dirname "$SCRIPT_DATA_FILE")
test -d "$SCRIPT_DATA_DIR" || mkdir -p "$SCRIPT_DATA_DIR"
}
LANG=C
#Erzeugt die statusdaten
debug "Generate actual status data"
crawl
exit 0

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-ra
PKG_RELEASE:=3
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-random
PKG_RELEASE:=3
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -0,0 +1,143 @@
#!/bin/sh
. /lib/functions.sh
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
. /usr/share/libubox/jshn.sh
json_load_file $SCRIPT_DATA_FILE
json_add_array "s2nproxy"
# Example for /etc/config/s2nproxy
#
# config s2nproxy 'DEVICE_NAME'
# option ip 'IP_ADDRESS'
# option device 'DEVICE_TYPE'
# option community 'COMMUNITY'
# SNMP Walk
walk() {
community=$1
ip=$2
oid=$3
echo $(snmpwalk -O vQ -P e -L n -v 1 -c $community $ip $oid)
}
# Format the dirty mikrotik mac address result
format_mac() {
echo $(echo $1 | xargs | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//' | sed 's/\ /\:/g')
}
s2np() {
if [ -z "$(uci -q get s2nproxy.$1.community)" ]; then
community="public"
else
community=$(uci get s2nproxy.$1.community)
fi
ip=$(uci get s2nproxy.$1.ip)
# Check if host is available
if ping -c 1 -W 1 $ip &> /dev/null ; then
json_add_object
json_add_string "ip" "$ip"
# Switch throught device types
case "$(uci -q get s2nproxy.$1.device)" in
airmaxac)
# Ubiquity AirMAX Richtfunk
name=$(walk $community $ip "iso.3.6.1.2.1.1.5.0" | xargs)
mac=$(format_mac "$(walk $community $ip 1.3.6.1.2.1.2.2.1.6.8)")
hw=$(walk $community $ip "iso.3.6.1.4.1.41112.1.4.1.1.9.1" | xargs)
signal=$(walk $community $ip "iso.3.6.1.4.1.41112.1.4.5.1.5")
capacity=$(walk $community $ip "iso.3.6.1.4.1.41112.1.4.5.1.10" / 1024)
capacity=$(printf %.2f "$((10**9 * $capacity / 1048576))e-9")
remotemac=$(format_mac "$(walk $community $ip iso.3.6.1.4.1.41112.1.4.5.1.4.1)")
latency=$(ping -qc1 -4 $ip 2>&1 | awk -F'/' 'END{ print (/^round-trip/? $4:"0") }')
json_add_string "type" "airmaxac"
json_add_string "mac" "$mac"
json_add_string "name" "$name"
json_add_string "hw" "$hw"
json_add_string "signal" "$signal"
json_add_string "capacity" "$capacity"
json_add_string "remotemac" "$remotemac"
json_add_string "latency" "$latency"
;;
mikrotikap)
# Mikrotik AP
name=$(walk $community $ip 1.3.6.1.2.1.1.5 | xargs)
fw=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.7.7 | xargs)
hw=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.7.9 | xargs)
frequency=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.3.1.7.1 | xargs)
frequency2=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.3.1.7.2 | xargs)
mac=$(format_mac "$(walk $community $ip 1.3.6.1.2.1.2.2.1.6.1)")
clients=$(( $(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.3.1.6.1) + $(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.3.1.6.2) ))
latency=$(ping -qc1 -4 $ip 2>&1 | awk -F'/' 'END{ print (/^round-trip/? $4:"0") }')
json_add_string "type" "mikrotikap"
json_add_string "mac" "$mac"
json_add_string "name" "$name"
json_add_string "hw" "$hw"
json_add_string "fw" "$fw"
json_add_string "frequency" "$frequency"
json_add_string "frequency2" "$frequency2"
json_add_string "clients" "$clients"
json_add_string "latency" "$latency"
;;
mikrotikw60grf)
# Mikrotik 60GHz Richtfunk
name=$(walk $community $ip 1.3.6.1.2.1.1.5 | xargs)
fw=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.7.7 | xargs)
hw=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.7.9 | xargs)
signal=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.8.1.8.1)
capacity=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.8.1.13.1)
frequency=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.8.1.6.1)
mac=$(format_mac "$(walk $community $ip 1.3.6.1.2.1.2.2.1.6.1)")
remotemac=$(format_mac "$(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.8.1.5.1)")
latency=$(ping -qc1 -4 $ip 2>&1 | awk -F'/' 'END{ print (/^round-trip/? $4:"0") }')
json_add_string "type" "mikrotikw60grf"
json_add_string "mac" "$mac"
json_add_string "name" "$name"
json_add_string "hw" "$hw"
json_add_string "fw" "$fw"
json_add_string "signal" "$signal"
json_add_string "capacity" "$capacity"
json_add_string "frequency" "$frequency"
json_add_string "latency" "$latency"
json_add_string "remotemac" "$remotemac"
;;
mikrotikw60gst)
# Mikrotik 60GHz Sektor
name=$(walk $community $ip 1.3.6.1.2.1.1.5 | xargs)
fw=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.7.7 | xargs)
hw=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.7.9 | xargs)
frequency=$(walk $community $ip 1.3.6.1.4.1.14988.1.1.1.8.1.6.1)
mac=$(format_mac "$(walk $community $ip 1.3.6.1.2.1.2.2.1.6.1)")
latency=$(ping -qc1 -4 $ip 2>&1 | awk -F'/' 'END{ print (/^round-trip/? $4:"0") }')
json_add_string "type" "mikrotikw60gst"
json_add_string "mac" "$mac"
json_add_string "name" "$name"
json_add_string "hw" "$hw"
json_add_string "fw" "$fw"
json_add_string "latency" "$latency"
json_add_string "frequency" "$frequency"
;;
latenz)
latency=$(ping -qc1 -4 $ip 2>&1 | awk -F'/' 'END{ print (/^round-trip/? $4:"0") }')
json_add_string "type" "latenz"
json_add_string "latency" "$latency"
;;
esac
json_close_object
fi
}
config_load s2nproxy
config_foreach s2np s2nproxy
json_close_object #s2nproxy
json_dump > $SCRIPT_DATA_FILE

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-simple-tc
PKG_RELEASE:=2
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -0,0 +1,37 @@
#!/bin/sh
. /lib/functions.sh
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
. /usr/share/libubox/jshn.sh
json_load_file $SCRIPT_DATA_FILE
config_load simple-tc
tc_enabled="0"
tc_in="0"
tc_out="0"
parseTcInterface() {
local iface="$1"
config_get ifname "$iface" ifname
[ "wan" = "$ifname" ] || return
config_get tc_enabled "$iface" enabled "0"
config_get tc_in "$iface" limit_ingress "0"
config_get tc_out "$iface" limit_egress "0"
}
config_foreach parseTcInterface 'interface'
json_add_object "traffic_control"
json_add_object "wan"
json_add_string "enabled" "$tc_enabled"
json_add_string "in" "$tc_in"
json_add_string "out" "$tc_out"
json_close_object #wan
json_close_object #traffic_control
json_dump > $SCRIPT_DATA_FILE
#exit 0

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-support
PKG_RELEASE:=9
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-sysupgrade
PKG_RELEASE:=13
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-timeserver
PKG_RELEASE:=3
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-uradvd
PKG_RELEASE:=2
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -11,10 +11,16 @@ URADVD_BIN=/usr/sbin/uradvd
service_triggers()
{
procd_add_reload_trigger "fff-uradvd"
procd_add_reload_trigger "fff-uradvd" "network"
}
start_service() {
procd_open_instance
procd_set_param command "$URADVD_BIN" -i br-client -p $(uci get network.globals.ula_prefix)
}
reload_service()
{
stop
start
}

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-vpn-select
PKG_RELEASE:=5
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,65 +1,45 @@
#!/bin/sh
# Usage: vpn-select <path-to-hood-file>
# To add a new protocol, put a file with three functions to /usr/lib/vpn-select.d/ .
# The file must start with protocol=name. It is most important to use the same name here and in hoodfile.
# The old config can be cleared in function ${protocol}_clear(). It is called first once per installed protocol.
# The function ${protocol}_addpeer() is called for every selected peer in hoodfile.
# The function ${protocol}_start_stop() is called at the end once per installed protocol.
. /usr/share/libubox/jshn.sh
hoodfile="$1"
make_config() {
# remove old config
rm /tmp/fastd_fff_peers/*
# source functions
for file in /usr/lib/vpn-select.d/*; do
[ -f $file ] && . "$file"
supported_protocols="$supported_protocols $protocol"
done
# prepare
Index=1
# clear old config
for protocol in $supported_protocols; do
"${protocol}_clear"
done
# configure vpn
if [ -n "$hoodfile" ] && [ -s "$hoodfile" ] ; then
json_load "$(cat "$hoodfile")"
json_select hood
json_get_var id id
json_select ".."
json_select vpn
# get fastd peers
while json_select "$Index" > /dev/null
do
json_get_keys vpn_keys
for key in $vpn_keys; do
json_select $key
json_get_var protocol protocol
if [ "$protocol" = "fastd" ]; then
# set up fastd
json_get_var servername name
filename="/etc/fastd/fff/peers/$servername"
echo "#name \"${servername}\";" > "$filename"
json_get_var key key
echo "key \"${key}\";" >> "$filename"
json_get_var address address
json_get_var port port
echo "remote \"${address}\" port ${port};" >> "$filename"
echo "" >> "$filename"
echo "float yes;" >> "$filename"
fi
"${protocol}_addpeer"
json_select ".." # back to vpn
Index=$(( Index + 1 ))
done
json_select ".." # back to root
}
# Only do something if file is there and not empty; otherwise exit 1
if [ -s "$hoodfile" ]; then
if [ ! -d /tmp/fastd_fff_peers ]; then
# first run after reboot
mkdir /tmp/fastd_fff_peers
make_config
# start fastd only if there are some peers
[ "$(ls /etc/fastd/fff/peers/* 2>/dev/null)" ] && /etc/init.d/fastd start
else
make_config
/etc/init.d/fastd reload
# fastd start/stop for various situations
pidfile="/tmp/run/fastd.fff.pid"
if [ "$(ls /etc/fastd/fff/peers/* 2>/dev/null)" ]; then
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) || /etc/init.d/fastd start
else
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) && /etc/init.d/fastd stop
fi
fi
exit 0
else
echo "vpn-select: Hood file not found or empty!"
exit 1
fi
# start/restart/stop vpnservices
for protocol in $supported_protocols; do
"${protocol}_start_stop"
done

View File

@ -1,5 +0,0 @@
#!/bin/sh
rm /tmp/fastd_fff_peers/*
/etc/init.d/fastd stop

View File

@ -0,0 +1 @@
vpn-select

View File

@ -0,0 +1,29 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-vxlan-node-vpn
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=base
CATEGORY:=Freifunk
TITLE:=Freifunk-Franken vxlan-node
URL:=http://www.freifunk-franken.de
DEPENDS:=+vxlan
endef
define Package/$(PKG_NAME)/description
This is the vxlan-node-vpn package for the Freifunk Franken Firmware
This will configure and set up the VPN via vxlan
endef
define Build/Compile
# nothing
endef
define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,16 @@
uci batch <<EOF
set network.vxlan0=interface
set network.vxlan0.proto=vxlan6
set network.vxlan0.port=8472
set network.vxlan0.ip6addr=auto
set network.vxlan0.srcportmin=8472
set network.vxlan0.srcportmax=8473
set network.vxlan0.ageing=30
set network.vxlan0.mtu=1422
set network.vxlan0.vid=0
set network.vxbat=interface
set network.vxbat.proto=batadv_hardif
set network.vxbat.master=bat0
set network.vxbat.ifname=vxlan0
EOF

View File

@ -0,0 +1,27 @@
protocol=vxlan
vxlan_clear() {
while uci -q delete network.@vxlan_peer[0]; do :; done
}
vxlan_addpeer() {
uci set network.vxlan0.vid="$id"
json_get_var address address
address=$(ping6 -w1 -c1 "$address" | awk '/from/ {print substr($4, 1, length($4)-1); exit}')
[ -z $address ] && return ## address not reachable
uci add network vxlan_peer
uci set network.@vxlan_peer[-1].vxlan="vxlan0"
uci set network.@vxlan_peer[-1].dst="$address"
}
vxlan_start_stop() {
uci commit network
# reload_config will not add new peers. A ifup is needed
ifup vxlan0
# this workaround is cleaning up old fdb entries
# and can be removed if someday netifd will do that
bridge fdb show dev vxlan0 state permanent | while read mac dst ip rest ; do
grep -q "$ip" /etc/config/network || bridge fdb del $mac dev vxlan0 dst $ip
done
}

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-web-hood
PKG_RELEASE:=2
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-web-mqtt
PKG_RELEASE:=1
PKG_RELEASE:=$(COMMITCOUNT)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-web-ui
PKG_RELEASE:=18
PKG_RELEASE:=$(shell echo -n $$(( $(COMMITCOUNT) + 20 )))
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-wireguard
PKG_RELEASE:=8
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-wireless
PKG_RELEASE:=20
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk

View File

@ -22,9 +22,9 @@ wifiGetFreq() {
local radio=$1
# Use hwmode for switching, since this is always set by firmware (effectively hard-coded)
# Use uci radio band for switching, since this is always set by firmware (effectively hard-coded)
# Do not use channel, as this might be "auto" for both
[ "$(uci get "wireless.${radio}.hwmode")" = "11a" ] && echo "5" || echo "2"
[ "$(uci get "wireless.${radio}.band")" = "5g" ] && echo "5" || echo "2"
return 0
}
# vim: set noexpandtab:tabstop=4

View File

@ -0,0 +1,33 @@
#!/bin/sh
SCRIPT_DATA_FILE=$(uci get nodewatcher.@script[0].data_file).json
. /usr/share/libubox/jshn.sh
json_load_file $SCRIPT_DATA_FILE
json_add_object "airtime"
w2dump="$(iw dev w2ap survey dump 2> /dev/null | sed '/Survey/,/\[in use\]/d')"
if [ -n "$w2dump" ] ; then
json_add_object "w2"
w2_ACT="$(ACTIVE=$(echo "$w2dump" | grep "active time:"); set ${ACTIVE:-0 0 0 0 0}; echo -e "${4}")"
w2_BUS="$(BUSY=$(echo "$w2dump" | grep "busy time:"); set ${BUSY:-0 0 0 0 0}; echo -e "${4}")"
json_add_string "active" "$w2_ACT"
json_add_string "busy" "$w2_BUS"
json_close_object #w2
fi
w5dump="$(iw dev w5ap survey dump 2> /dev/null | sed '/Survey/,/\[in use\]/d')"
if [ -n "$w5dump" ] ; then
json_add_object "w5"
w5_ACT="$(ACTIVE=$(echo "$w5dump" | grep "active time:"); set ${ACTIVE:-0 0 0 0 0}; echo -e "${4}")"
w5_BUS="$(BUSY=$(echo "$w5dump" | grep "busy time:"); set ${BUSY:-0 0 0 0 0}; echo -e "${4}")"
json_add_string "active" "$w5_ACT"
json_add_string "busy" "$w5_BUS"
json_close_object #w5
fi
json_close_object #airtime
json_dump > $SCRIPT_DATA_FILE
#exit 0

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff
PKG_RELEASE:=9
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk