Compare commits

...

133 commits

Author SHA1 Message Date
Moritz Warning
a9e43101bb nodogsplash: explicit file copy
Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit 2a725e7cbe)
2023-10-23 21:41:25 +02:00
Moritz Warning
df63e160b5 nodogsplash: update to version 5.0.2
Fix a buffer overflow in case the
query string is too long.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit fe1c67fb3d)
2023-10-23 21:41:25 +02:00
Moritz Warning
46203cf6f3 nodogsplash: remove opennds from conflicts
OpenNDS lists nodogsplash a conflict as well.
This causes a circular reference that is not allowed.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit 967dde509b)
2023-10-23 21:41:25 +02:00
Moritz Warning
4b975075a7 nodogsplash: update to 5.0.1
Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit 91e07907fa)
2023-10-23 21:41:25 +02:00
Josef Schlehofer
4cc8a2ff5b nodogsplash: fix SPDX License Identifier and reordering
- Add PKG_LICENSE_FILES
- Use two spaces instead of tabs

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit c64e02c5b5)
2023-10-23 21:41:25 +02:00
Jeffery To
1aeda8e982 CI: Add local feed for CI-built packages
To test each package, the CI-built target package (ipk) file is
installed, but currently the target package's dependencies are installed
from the standard opkg feeds.

There are cases when the CI-built target packages should be
installed/tested together:

* If a pull request contains several new packages that depend on each
  other, the test step will fail as the new dependencies cannot be found
  in the current packages feed.

* If a pull request upgrades a source package that builds several target
  packages that depend on each other, the test step may fail due to the
  version/ABI mismatch between a newer target package and the older
  dependencies installed from the packages feed.

This sets up a local feed for the CI-built packages so that dependencies
are also installed from the same set of packages.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit f818fe716e)
2023-10-23 17:02:01 +02:00
Jeffery To
0bc50215c4 CI: Do package run-tests only if target packages were built
Currently, the package run-test phase will fail for PRs that only
add/update host-only packages, as no target packages (*.ipk) are built.

This checks if any target packages are built before attempting the
run-tests.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 299ee2b1cf)
2023-10-23 17:01:20 +02:00
Josef Schlehofer
274aea3873 ci: change default packages
Since this file was taken from packages repository, it tries to compile
packages from that repository as fallback if changes are not detected.

Let's change these packages to some, which are present in this
repository, so they will be compiled as test.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit c9a8f2d032)
2023-10-23 17:00:30 +02:00
Alois Klink
397d7afbd0 github-ci: error on any shell errors
Enable `errexit` and `nounset` [POSIX shell options][1]
in `.github/workflows/entrypoint.sh` so that the script fails
if any command within the script fails.

[1]: https://pubs.opengroup.org/onlinepubs/9699919799//utilities/V3_chap02.html#set

Reported-by: Marius Dinu <m95d+git@psihoexpert.ro>
Fixes: https://github.com/openwrt/packages/issues/19953
Signed-off-by: Alois Klink <alois@aloisklink.com>
(cherry picked from commit 03ca0722f7)
2023-10-23 17:00:24 +02:00
Christian Marangi
4ed33a15c3 ci: update github actions to v3
Update checkout and upload-artifact action to v3 to mute nodejs
deprecation warning.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 52570d4242822e3db678f5484c2ca3e72f485d52)
(cherry picked from commit 5d87b95697)
2023-10-23 17:00:18 +02:00
Jeffery To
a9c09983f5 ci: Use openwrt/gh-action-sdk@v5
The previous build errors with v5 have been fixed. This version builds
packages as a normal user instead of as root.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit e2d72c5775)
2023-10-23 17:00:11 +02:00
Bradford Zhang
d79f2b57eb bird2: bump to version 2.13.1
Signed-off-by: Bradford Zhang <zyc@zyc.name>
(cherry picked from commit d98b9b5052)
2023-06-30 01:17:49 +02:00
Bradford Zhang
8bbe9ceafa bird2: bump to version 2.13
Signed-off-by: Bradford Zhang <zyc@zyc.name>
(cherry picked from commit 6410411b12)
2023-05-20 00:09:54 +02:00
Josef Schlehofer
8071852b45
Merge pull request #959 from rogerpueyo/openwrt-21.02-backport-bird1-fixes
Backport bird1-openwrt fixes to 21.02
2023-03-09 09:20:05 +01:00
Roger Pueyo Centelles
b1882bc9a4 bird1: fix "Form token mismatch" errors in luci-app-bird1-ipv{4,6}
The "Filters", "Functions" and "Status" sections of the web interfaces
for both Bird4 and Bird6 threw the following error upon performing any
action:

   Form token mismatch
   The submitted security token is invalid or already expired!

Changing their entry types from "cbi" to "form" fixes them.

Fixes #922.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit c37fbab8f5)
2023-03-08 22:19:17 +01:00
Roger Pueyo Centelles
258826e83a bird1: rename get_bool() to get_a_bool() in bird{4,6}-lib.sh
This patch renames the get_bool() function, implemented in the
bird4-lib.sh and bird6-lib.sh files (respectively, for the IPv4 and
the IPv6 versions of the package), as well as all the calls to it.
This way, we avoid a function name collision with the one provided by
file /lib/functions.sh, which is slightly different and caused an
out-of-memory error when parsing the bird4/bird6 UCI config files.

Fixes #920.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit d32f93e049)
2023-03-08 22:19:17 +01:00
Roger Pueyo Centelles
7830857eee bird1-openwrt: fix Makefile issues
This commit replaces the deprecated licensing text with an SPDX license
identifier, and removes tab indentations in the conffiles sections.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit 6697ca291f)
2023-03-08 22:19:17 +01:00
Roger Pueyo Centelles
812d8cc8a3 bird1-openwrt: use a single Makefile for IPv4 and IPv6 packages
Having two Makefile files, respectively in the bird1-openwrt-ipv4 and
bird1-ipv6-openwrt folders, made the CI tests fail at the time of
building the packages, due to a compilation error. This patch merges
both Makefile files into a single one. As a result, package compilation
succeeds during the CI tests.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit 914c27aeb6)
2023-03-08 22:19:15 +01:00
Bradford Zhang
83bb4b5d97 bird2: bump to version 2.0.12
Signed-off-by: Bradford Zhang <zyc@zyc.name>
(cherry picked from commit 7d6f3c0492)
2023-02-22 11:23:54 +01:00
Nick Hainke
0621622dc5 babeld: remove AUTORELEASE
AUTOREMOVE is now deprecated.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 20e1b16a97)
2023-02-10 10:12:45 +01:00
Nick Hainke
c04e05af56 babeld: update to 1.12.2
Release announcement:
https://alioth-lists.debian.net/pipermail/babel-users/2023-February/004038.html

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit bb65c3a18d)
2023-02-10 08:15:11 +01:00
Bradford Zhang
2c21c1627b bird2: bump to version 2.0.11
Signed-off-by: Bradford Zhang <zyc@zyc.name>
2022-12-21 09:55:53 +01:00
Simon Wunderlich
4e2bdb42f6
Merge pull request #919 from ecsv/batadv-for-21.02
openwrt-21.02: batman-adv: Merge bugfixes from 2022.3
2022-11-11 16:48:40 +01:00
Sven Eckelmann
e2daa846bd batman-adv: Merge bugfixes from 2022.3
* Fix hang up with small MTU hard-interface

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-10 21:36:54 +01:00
Simon Wunderlich
2822b3488d
Merge pull request #914 from ecsv/batadv-for-21.02
openwrt-21.02: alfred/batman-adv: Rebuild on CONFIG*_ALFRED_*/CONFIG_BATMAN_ADV_ changes
2022-10-24 10:44:34 +02:00
Sven Eckelmann
bbcd264ede alfred: Rebuild on CONFIG*_ALFRED_* changes
The buildsystem doesn't know that the Package/*/config kconfig symbols are
related to the alfred package build. It is necessary to explicitly define it
via PKG_CONFIG_DEPENDS.

Fixes: f76074d424 ("alfred: add alfred 2013.3.0 to feed")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-10-23 10:20:49 +02:00
Sven Eckelmann
2a6caca43d batman-adv: Rebuild on CONFIG_BATMAN_ADV_* changes
The buildsystem doesn't know that the KernelPackage/*/config kconfig
symbols are related to the batman-adv package build. It is necessary to
explicitly define it via PKG_CONFIG_DEPENDS.

Fixes: 522ce8dfdb ("batman-adv: rename folder name to match project & package name")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-10-23 10:14:30 +02:00
Rob White
25e76489c8 mesh11sd: Release v1.2.0
Maintainer: Rob White rob@blue-wave.net
Compile tested: All
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, x86-64, on 21.02, 22.03 and snapshot.

Description:
  * This version adds new functionality.
  * Update README.md
  * Add - Traffic volume, Peers and stations to status output [bluewavenet]
  * Add - limit up-checks to mesh interfaces only [bluewavenet]

 -- Rob White <dot@blue-wave.net>  Mon, 08 Aug 2022 13:40:31 +0000

Signed-off-by: Rob White <rob@blue-wave.net>
(cherry picked from commit 290ed82bd8)
2022-08-14 18:09:10 +02:00
Rob White
03e827edf1 opennds: Release v9.8.0 [21.02]
Maintainer: Rob White rob@blue-wave.net
Compile tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, x86-64
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, x86-64; on 21.02

  * This version adds new functionality, and fixes some issues
  * Fix - suppress stderr in client_params in generic linux [bluewavenet]
  * Fix - client_params on generic linux, remote logo not supported yet [bluewavenet]
  * Fix - compiler warning [bluewavenet]
  * Fix - set voucher script as executable [bluewavenet]
  * Update OpenWrt Makefile [bluewavenet]
  * Add - format footer in Themespec scripts [bluewavenet]
  * Update footer on all scripts [bluewavenet]
  * Update - Community Voucher Themespec [bluewavenet]
  * Add - Check on startup for Y2.038K bug (32 bit time) [bluewavenet]
  * Fix - Remove deprecated Debian specific files [bluewavenet]
  * Add - More css updates [bluewavenet]
  * Add - user friendly RFC8910 page511 text and remove refresh button [bluewavenet]
  * Fix - MHD becomes unresponsive serving page 511 for rfc8910 clients [bluewavenet]
  * Add - extra startup settings - ignore_sigpipe and write nds info [bluewavenet]
  * Add - set MHD connection limit to 100, set MHD listen backlog size to 128, set MHD_HTTP_HEADER_CONNECTION "close" [bluewavenet]
  * Fix - Add missing LOG_CRIT in debug [bluewavenet]
  * Add - some useful diagnostic output in authmon [bluewavenet]
  * Fix - Move testing to community [bluewavenet]
  * Fix - Community - Use tmpfs by default for vouchers.txt file [bluewavenet]
  * Add - README with use instructions and notice about flash wearout [fservida]
  * Fix - Refactor folder structure for community themespec [fservida]
  * Add - Create vouchers.txt [fservida]
  * Add - Create theme_voucher.sh [fservida]
  * Update - README.md [bluewavenet]
  * Add - image download info message [bluewavenet]
  * Add - css updates [dianariyanto]
  * Add - allow downloaded remotes refresh for all modes [bluewavenet]
  * Add - download_resources.sh to installed files [bluewavenet]
  * Add - support for download of custom images and files in the status.client page [bluewavenet]
  * Remove - Debian man page support [bluewavenet]
  * Fix - Add missing mkdir command in Makefile [dzatoah]
  * Fix - typos in src/{conf, main}.c [dzatoah]

Signed-off-by: Rob White <rob@blue-wave.net>
2022-08-10 07:53:59 +02:00
Toke Høiland-Jørgensen
b08cc3eef4
Merge pull request #897 from mbargo23/bird21.02
bird2: bump to version 2.0.10
2022-06-29 15:10:57 +02:00
Jan Betik
ebf29ae836
bird2: bump to version 2.0.10
Signed-off-by: Jan Betik <jan.betik@nic.cz>
(cherry picked from commit 1fa9fa339c)
2022-06-29 14:35:57 +02:00
Nick Hainke
e3f0d89220 olsrd: replace patch for storms with real patch
Fixes: bb5bbc6afd ("olsrd: import patch to prevent olsr storms")

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit cfd82729a9)
2022-06-23 14:04:47 +02:00
William Fleurant
846a7fd72f cjdns: support the supernodes feature (#884)
Signed-off-by: William Fleurant <meshnet@protonmail.com>
(cherry picked from commit d705f79890)
Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-06-21 00:00:51 +02:00
William Fleurant
6b7863eb0f cjdns: bump v21.1 and patch find-python (#883)
* cjdns: bump source from v21 to v21.1
* cjdns: bump release with patch to prefer python2
* cjdns: refresh patches and remove patch musl

Signed-off-by: William Fleurant <meshnet@protonmail.com>
(cherry picked from commit 217330bb5e)
Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-06-20 23:31:14 +02:00
Nick Hainke
bdefc8348b naywatch: add log when naywatch activates
Naywatch now prints
  naywatch: Naywatch Activated!
when becoming active.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 09d5ceb923)
2022-06-10 10:34:10 +02:00
Rosen Penev
ba06292f31 oonf-dlep-radio: fix compilation with Ninja
Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 034ec30869)
2022-06-10 01:49:59 +02:00
Nick Hainke
96c9214707 oonf-olsrd2: set PKG_MIRROR_HASH and refresh patch
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit d709225ed0)
2022-06-10 01:49:59 +02:00
Rosen Penev
af958cfd79 oonf-olsrd2: fix compilation with Ninja
Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 519d7bae29)
2022-06-10 01:49:59 +02:00
Rob White
bfd645b8a8 mesh11sd: Release v1.1.1
Maintainer: Rob White rob@blue-wave.net
Compile tested: All
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, x86-64, on 21.02.2 and snapshot.

Description:
  * This version adds new functionality, and fixed some issues
  * Fix - repeated syslog messages - output only on mode change [bluewavenet]
  * Add - service status to json output [bluewavenet]
  * Add - support for multiple mesh interfaces [bluewavenet]
  * Fix - duplicate ifname if more than one mesh interface [bluewavenet]
  * Add - compatibility with iw < v5.16-1 [bluewavenet]
  * Add - search and delete phantom meshnodes [bluewavenet]

Signed-off-by: Rob White <rob@blue-wave.net>
(cherry picked from commit 1cd90655da)
2022-05-22 10:58:08 +02:00
Nick Hainke
bbf05e4082 babeld: rewrite description
Babel is now a IETF standard. Update the package description.
Fixes: #867

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 983096d308)
2022-05-19 15:37:53 +02:00
Nick Hainke
8cf177a86c babled: update to 1.12.1
Changelog:
916d3d9 Update CHANGES for babeld-1.12.1
3d8aec4 Schedule an interface check after adding an interface.
f13602b Split last PC into unicast and multicast values

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 9028f67afd)
2022-05-19 15:18:27 +02:00
Simon Wunderlich
d159eb55d2
Merge pull request #859 from ecsv/batadv-for-21.02
openwrt-21.02: batman-adv: Merge bugfixes from 2022.0
2022-05-08 15:00:28 +02:00
Nick Hainke
03fededc74 babeld: update to 1.12
Changelog:

5 May 2022: babeld-1.12

  * Implement v4-via-v6 routing (RFC 9229), which allows a router with
    IPv4 addresses only to route IPv4.  Thanks to Théophile Bastian.
  * Enable extended Netlink acks when available.
    Thanks to Toke Høyland-Jørgensen.
  * Fix restoring of interface configuration to avoid unbounded memory
    consumption.  Thanks to andrew-hoff.
  * Fix handling of deny filters in the install chain.

Refreshed patches:
- 600-add-ubus.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit b35766330b)
2022-05-08 13:07:37 +02:00
Sven Eckelmann
272b8f8afc alfred: Merge bugfixes from 2022.1
* Ensure processed change_iface packet is 0-terminated

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-05-06 22:58:20 +02:00
Sven Eckelmann
bc04956c59 batctl: Merge bugfixes from 2022.1
* ping: Skip sleep after last packet

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-05-06 22:50:18 +02:00
Sven Eckelmann
09a054faf9 batman-adv: Merge bugfixes from 2022.1
* Request iflink once in batadv-on-batadv check
* Request iflink once in batadv_get_real_netdevice
* Don't expect inter-netns unique iflink indices
* Don't skb_split skbuffs with frag_list

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-05-06 22:50:18 +02:00
Simon Wunderlich
b987eb3a90
Merge pull request #853 from ecsv/batadv-for-21.02
openwrt-21.02: batman-adv: compat: Add atomic mc_forwarding support for stable kernels
2022-04-18 13:59:37 +02:00
Sven Eckelmann
b8461cc299 batman-adv: compat: Add atomic mc_forwarding support for stable kernels
Eric Dumazet changed the mc_forwarding in commit 145c7a793838 ("ipv6: make
mc_forwarding atomic") the type of mc_forwarding from __s32 to an atomic_t.
This patch was then ported to various stable kernels.

This code change caused a FTBFS when in batman-adv when
CONFIG_BATMAN_ADV_MCAST was activated. To work around this problem, provide
a version for kernels with __s32 mc_forwarding and a version for kernel
with atomic_t mc_forwarding.

Fixes: #850
Reported-by: Huangbin Zhan <zhanhb88@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-04-17 14:07:15 +02:00
Rob White
a0d61bddb3 mesh11sd: [New Package] Release v1.0.0
Maintainer: Rob White rob@blue-wave.net
Compile tested: All
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, x86-64, on 21.02.2

Description:
  Mesh11sd is a dynamic parameter configuration daemon for 802.11s mesh networks.
  It was originally designed to leverage 802.11s mesh networking at Captive Portal venues.
  This is the open source version and it enables easy and automated mesh network operation with multiple mesh nodes.
  It allows all mesh parameters supported by the wireless driver to be set in the uci config file.
  Settings take effect immediately without having to restart the wireless network.
  Default settings give rapid and reliable layer 2 mesh convergence.
  Without mesh11sd, many mesh parameters cannot be set in the uci wireless config file as the mesh interface must be up before the parameters can be set.
  Some of those that are supported, would fail to be implemented when the network is (re)started resulting in errors or dropped nodes.
  The mesh11sd daemon dynamically checks configured parameters and sets them as required.
  This version does not require a Captive Portal to be running.

Signed-off-by: Rob White <rob@blue-wave.net>
(cherry picked from commit b4ab896894)
2022-04-09 11:25:42 +02:00
Nick Hainke
6166db3224 naywatch: fix reboot_now
Naywatch should first try to reboot normally, and if that does not work
do a hard reboot. However, the hard reboot was never called.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 65f747a8bc)
2022-04-01 10:31:05 +02:00
Nick Hainke
c96b10188b babeld: bump to version 1.11
30 March 2022: babeld-1.11

  * Implemented MAC authentication (RFC 8967).  Thanks to Clara Dô,
    Weronika Kołodziejak and Antonin Décimo.
  * Changed the interface of the add_filter function in order to simplify
    integration in OpenWRT.  Thanks to Nick Hainke.

Detailed List:
7c053fe Export add_filters and simplify interface.
91c44f8 Rename blake2s to blake2s128.
dda8d63 Update CHANGES.
43a0066 Allow Blake2s keys up to 32 bytes.
375ea5f Rename interface option hmac to key.
1b9abc4 Replace hmac-verify with accept-bad-signatures.
3777eb4 Ignore .gitmodules when releasing an archive.
3551b45 Simplify and fix preparse phase.
ba8f116 Add rate limitations for challenges.
6d44238 Show PC number.
ceda3a0 Expire Index and challenge timer.
d66a4d2 Ignore a Challenge Request received on multicast.
024c17a Fix confusion between INDEX_LEN and NONCE_LEN when sending PC TLV.
ceb021f Fix double-free in error path.
1e08aed Change no_hmac_verify to hmac-verify.
c7ad387 Use 'hmac-sha256' and not 'sha256'.
5a15957 Fix nodes incorrectly rejecting packets.
af02039 Append a PC message if Babel-MAC is enabled.
46fc7da Follow the spec closely for the preparse phase.
87f39d0 Rename MAC functions and constants to match the spec.
02b14e3 Helpful error messages in key configuration.
d763f3e Error if configured key can't be found.
3cb0ab7 Use RFC3542 for IPv6 on macOS.
69df1cb Use _GNU_SOURCE instead of __USE_GNU.
ef3a113 Don't copy nonce, suppress VLA.
c243769 Move key validation in parse_key.
b06b2fc Constify source argument of fromhex.
9529941 Use AUTH_TYPE_NONE consistently.
d922b64 Document the HMAC options in manual page.
0c4afc2 Only allow keys configured on a given interface.
7de6715 Create neighbour after checking HMAC.
ecd1f42 Fix typo in compare_hmac.
9a5de34 Fix HMAC-SHA-256 computation.
f1051fd Fix constants to be consistent with SHA-256.
9688b68 Fix memory leaks in error-handling paths in configuration parser.
4d8a831 Fix some more (read-only) buffer overflows.
ebda926 Fix potential memory leaks.
d53fec0 Use AUTH_TYPE_* consistently.
a1afd51 Add no_hmac_verify flag.
b4e28f2 Fix ordering of fields in pseudo-header.
c8ace8b Use IANA-assigned TLV numbers.
739f76a Implement HMAC authentication.
e3adf47 Compile with SHA-256 and Blake2s.
ca0a512 Add SHA-2 and Blake2 submodules.
756783e Untabify

Remove upstreamed patches:
- 000-export-add-filters-and-simplify-interface.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit dbff012a2f)
2022-03-31 13:12:14 +02:00
Petr Štetiar
5edac3e213 ci: use openwrt/gh-action-sdk@v4
In order to use feeds from GH mirror for GH actions, thus saving a lot
of resources being wasted. While at it fix whitespace issue.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
[applied to routing feed]
[whitespace issue not existing in routing feed]
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 5702d2e40b)
2022-03-30 23:20:23 +02:00
Paul Spooren
0d5e81403d CI: update SDK action to v3
No also check mirror hashes and badly formated init files

Signed-off-by: Paul Spooren <mail@aparcar.org>
[applied to routing feed]
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 2134c56d12)
2022-03-30 23:20:23 +02:00
Nick Hainke
15d83eff07 babeld: add add_filter function
You can define filter functions in babeld by:

   in if eth0 metric 128

This commit adds the ubus equivalent to dynamically add filter on
runtime:

  ubus call babeld add_filter '{"ifname":"eth0", "type":"input",
                                "metric":128}'

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit a618159d33)
2022-03-30 12:44:35 +02:00
Nick Hainke
7c7d11e290 olsrd: set lqm via ipc
You can now give a lqm when adding an interface:
  ubus call olsrd add_interface '{"ifname":"wg_51821", "lqm":"0.5"}'

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit e3c6842923)
2022-03-26 19:00:40 +01:00
Rob White
fc0b140689 opennds: Release v9.7.0 (for 21.02)
Maintainer: Rob White rob@blue-wave.net
Compile tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, x86-64, on 21.02.2

  * This version adds new functionality, and fixes some issues
  * Fix - syntax error (missing comma) in awk command in bash on generic Linux [bluewavenet]
  * Add - option to append serial number suffix to gatewayname [bluewavenet]
  * Add - block use of ip aliases on gateway interface [doctor-ox] [bluewavenet]
  * Fix - ndsctl json syntax error [bluewavenet]
  * Add - check for null variables in key value pairs in MHD callbacks [bluewavenet]
  * Fix - changed some notice messages into debug messages [bluewavenet]
  * Fix - possible return of incorrect pid [doctor-ox] [bluewavenet]
  * Fix - possible abiguities resulting in failure to parse parameters correctly [bluewavenet]
  * Fix - Remove deprecated get_client_token.sh [bluewavenet]
  * Fix - Prevent possible malformed mac address returned from dhcpcheck() [doctor-ox] [bluewavenet]

Signed-off-by: Rob White <rob@blue-wave.net>
2022-03-22 22:09:42 +01:00
William Fleurant
5971f1937c cjdns: pass for some build warnings (#738)
Compile time changes reviewed by cjd.
Due to stricter compiler(s) we do not
want to error for these warnings.

Caused by: ...reading "past the end"
of a struct, because the struct is
actually a header and the body is of
unknown size. Compilers got stricter
and this became a warning.

Signed-off-by: William Fleurant <meshnet@protonmail.com>
(cherry picked from commit 71c11ab1b7)
[Fix compiling]
Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-03-13 13:29:34 +01:00
Etienne Champetier
b88e322a51 cjdns: fix uci-defaults (#714)
Since https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=4b9a67362d70c544b85078b8d5c661f43f7472d9,
uci network config interface sections use 'device' instead of 'ifname'

Even if 'device' seems to always be set by
package/base-files/files/bin/config_generate, we keep the fallbacks
in case someone install the package via opkg and has a non migrated
network config

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit 383c52ff8d)
2022-03-07 09:48:31 +01:00
Josef Schlehofer
6501c70f44 mrd6: Makefle reordering
- Switch to AUTORELEASE

- Changed package versioning:
Before: mrd6_2013-11-30-c805eb33255dbc0b6647d463c6c67d1c9d3105a0-3_arm_cortex-a9_vfpv3-d16.ipk
After: mrd6_2013-11-30-c805eb33-1_arm_cortex-a9_vfpv3-d16.ipk

- Remove defaults, which are already defaults

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit e06a6c962b)
2022-02-26 17:04:48 +01:00
Eneas U de Queiroz
fb03ab09c8 mcproxy: include PKG_MIRROR_HASH, refresh patches
This avoids unnecessary downloads and rebuilds.
Patches were refreshed to please github PR checks.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 564ca99e2c)
2022-02-26 15:34:32 +01:00
Eneas U de Queiroz
3b84442486 pimbd: include PKG_MIRROR_HASH
This avoids unnecessary downloads and rebuilds.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit ade1fa6ebc)
2022-02-26 15:34:32 +01:00
Eneas U de Queiroz
65ae8eadd7 minimalist-pcproxy: include PKG_MIRROR_HASH
This avoids unnecessary downloads and rebuilds.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit e9d5f990a3)
2022-02-26 15:34:32 +01:00
Eneas U de Queiroz
4dfa42ee42 mrd6: include PKG_MIRROR_HASH
This avoids unnecessary downloads and rebuilds.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 9cb03f0a2f)
2022-02-26 15:34:32 +01:00
Josef Schlehofer
fd76bed2c3 oonf-dlep-radio: refactor define Package/oonf-dlep-radio
- Why there was oonf-git? WTF?
- Use two spaces instead of tabs

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 282af3f8bc)
2022-02-26 13:07:35 +01:00
Josef Schlehofer
3c70d0155e oonf-dlep-radio: refactor Makefile (package versioning, downloading)
- By this change, we are using downloading .tar.xz (which is default in OpenWrt)
Reference: OpenWrt base repository include/download.mk

Downloaded tarball size is ~60 kB smaller.

- Removed "v" in package naming.
Before: oonf-dlep-radio_v0.15.1_arm_cortex-a9_vfpv3-d16.ipk
After: oonf-dlep-radio_0.15.1_arm_cortex-a9_vfpv3-d16.ipk

Removed stuff, which is no longer needed like PKG_REV.

- Switch to AUTORELEASE in PKG_RELEASE

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 56fc0d7226)
2022-02-26 13:07:35 +01:00
Nick Hainke
550502cbd6 oonf-dlep-proxy: add PKG_MIRROR_HASH
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 24b27f0875)
2022-02-26 10:09:18 +01:00
Rosen Penev
b99b6faf95 oonf-dlep-proxy: fix compilation with Ninja
Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit c762d3fd0f)
2022-02-26 10:09:18 +01:00
Nick Hainke
e2eaefef59 oonf-dlep-radio: add PKG_MIRROR_HASH
Fixes:
oonf-dlep-radio-v0.15.1.tar.bz2: Download from https://github.com/OLSR/OONF.git failed
oonf-dlep-radio-v0.15.1.tar.bz2: Requires sha256sum for verification

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 9a90e3dd65)
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
[added commit message]
2022-02-25 07:57:03 +01:00
Rob White
0de13bc5f4 opennds: Release v9.6.0 (for 21.02)
Maintainer: Rob White rob@blue-wave.net
Compile tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, gl-inet b1300, gl-inet mt300n-v2, Snapshot, 21.02.1, 19.07.8

Description:
This version adds new functionality, and fixes some issues
It requires iptables(legacy)
  * Fix - correctly display return buffer in syslog [bluewavenet]
  * Add - use heap allocation for library call return buffer [bluewavenet]
  * Fix - OpenWrt, fhook request for fw3 [bluewavenet]
  * Add - spider remote urls before downloading [bluewavenet]
  * Add - OpenWrt, revert uncommitted uci updates at startup and shutdown [bluewavenet]
  * Fix - remove unneccesary flash writes and fix hosts updates [doctor-ox] [bluewavenet]
  * Add - Updated splash images [bluewavenet]
  * Add - OpenWrt makefile for nft or ipt dependencies [bluewavenet]
  * Fix - grep by word to prevent any ambiguity [doctor-ox] [bluewavenet]
  * Fix - ensure rate limiting is disabled if rate thresholds are set to zero [bluewavenet]
  * Add - querystring support for client status page [bluewavenet]
  * Add - Advanced/standard status page checkbox [bluewavenet]
  * Add - set default session timeout to 24 hours [bluewavenet]
  * Fix - potential buffer overflow [bluewavenet]
  * Fix - Restrict max packet limit to iptables maximum [bluewavenet]
  * Fix - descriptive labels on ndsctl status output [bluewavenet]
  * Add - update of README.md [bluewavenet]
  * Fix - Added required variable to FAS return string example documentation [dorkone]
  * Add - Default checkinterval set to 15 seconds [bluewavenet]
  * Fix - incoming and outgoing counters when unlimited bursting is enabled [bluewavenet]
  * Add - maximum bucket size configuration [bluewavenet]
  * Add - calculate moving average packet size for rate limiting [bluewavenet]
  * Add - some operational default values [bluewavenet]
  * Add - initial rate limits when unrestricted bursting is disabled [bluewavenet]
  * Add - Require clients to be in the dhcp database [bluewavenet]
  * Add - dhcpcheck library call [bluewavenet]
  * Fix - Remove trailing whitespace when getting clientaddress if client not active [bluewavenet]
  * Fix - Segfault when FAS fails to Return customstring [dorkone] [bluewavenet]
  * Add - Enable/Disable unrestricted bursting [bluewavenet]
  * Add - gatewayurl to querystring and use in place of originurl in FAS [bluewavenet]
  * Fix - more accurate debug message [bluewavenet]
  * Fix - Show packet rate correctly as packets per minute [bluewavenet]
  * Add - Report Packet Rate and Bucket Size in ndsctl status and json and status client page [bluewavenet]
  * Add - rate limit refresh to client limit rules [bluewavenet]
  * Fix - code readability [bluewavenet]
  * Fix - Documentation for data sent to Authmon Daemon [bluewavenet]
  * Add - Show unrestricted burst intervals in ndsctl status [bluewavenet]
  * Add - Set default bucket ratios to 10 [bluewavenet]

Signed-off-by: Rob White <rob@blue-wave.net>
2022-02-20 12:54:37 +01:00
Nick Hainke
10d3ffd8b3 olsrd: fix setting default interface config
The IPC should apply the "InterfaceDefaults".

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 4afbe17480)
2022-02-13 18:32:20 +01:00
Simon Wunderlich
a9bf9947ed
Merge pull request #782 from ecsv/batadv-for-21.02
openwrt-21.02: batman-adv: Merge bugfixes from 2022.0
2022-02-03 21:21:49 +01:00
Sven Eckelmann
9e2383e9b4 batman-adv: Merge bugfixes from 2022.0
* allow netlink usage in unprivileged containers
* mcast: don't send link-local multicast to mcast routers

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-02-03 20:17:50 +01:00
Nick Hainke
bb0f31a7a7 babeld: remove unused return variable
There is an unused variable in the function. Remove it.

Fixes: 3852004435 ("babeld: add add_interface function").

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 879725ce3e)
2022-02-01 21:53:04 +01:00
Nick Hainke
bcc3588328 babeld: add add_interface function
An interface can be added dynmiacally to babeld by starting babeld with
the local management interface (-G) and saying:
  interface eth0

Add the ubus equivalent of this function:
  ubus call babeld add_interface '{"ifname":"eth0"}'

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 3852004435)
2022-02-01 21:53:04 +01:00
Nick Hainke
c2e138d49f olsrd: add ubus ipc integration to olsrd
IPC integration of olsrd with OpenWrt. Allow dynamic adding and removing
of interfaces at run-time. We need to rename the avl-tree files, since
libubox also defines avl tree. Also add patch to allow meshing via
wireguard point-to-point links.

The ubus interface offers following functions:
  - add_inteface '{"ifname":"wg_51820"}'
  - del_inteface '{"ifname":"wg_51820"}'

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 0bffe620b4)
2022-01-17 09:41:46 +01:00
Paul Spooren
7d07ef90fd CI: fix runtime testing for non master branch
The runtime testing always ran on master branch aka snapshots since the
branch wasn't passed over to the container execution!

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 817240b07c)
2022-01-15 14:43:38 +01:00
Nick Hainke
61cd00cb8e naywatch: introduce kick-count
Check multiple rounds if neighbors are available before kicking. This
should reduce unneeded reboots.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 24285ce4fc)
2022-01-13 10:10:03 +01:00
Nick Hainke
440e7af339 naywatch: fix mode without watchdog
The if-condition was always evaluated to be true.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit cf34c5a4a1)
2022-01-13 09:04:43 +01:00
Nick Hainke
c8b613e11c olsrd: fix meshing via wireguard tunnels
The procd script was not adding the wireguard interfaces. Add corner case
in the init script to allow meshing via wireguard.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 576967a2a3)
2022-01-08 22:55:55 +01:00
Rob White
a85b7c7ea8 opennds: Release v9.5.1 (for 21.02)
Maintainer: Rob White rob@blue-wave.net
Compile tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, gl-inet b1300, gl-inet mt300n-v2, Snapshot, 21.02.1, 19.07.8

Description:
This version adds new functionality, and fixes some issues
  * Fix - ThemeSpec file downloads when mwan3 is running [bluewavenet]
  * Fix - Preemptive auth failure after previous deauth [minhng99] [bluewavenet]

From v9.5.0
  * Add - use average packet size instead of MTU when implementing rate limiting [bluewavenet]
  * Fix - typo in iptables command and remove a redundant command [bluewavenet]
  * Add - startdaemon() and stopdaemon() utility functions [bluewavenet]
  * Add - combined interface/ipaddress external gateway status monitoring [bluewavenet]
  * Fix - potential online/offline detection problem when mwan3 is running [bluewavenet]
  * Add - get_debug_level and syslog library calls [bluewavenet]
  * Fix - correctly reset upload and download rate rules [bluewavenet]
  * Add - extend upstream gateway checking for use with mwan3 loadbalance/failover [bluewavenet]
  * Fix - Potential NULL pointer segfault in http_microhttpd on calling authenticated() [bluewavenet]
  * Fix - Potential NULL pointer segfault in http_microhttpd on calling preauthenticated() [dddaniel]
  * Add - Calculate Bucket size based on achieved burst rate [bluewavenet]
  * Fix - prevent parameter parsing if clientip not known [bluewavenet]
  * Add - disable rate quotas by setting bucket ratio to zero [bluewavenet]
  * Fix - suppress some debug messages [bluewavenet]
  * Add - more libraries documentation [bluewavenet]
  * Add - library calls startdaemon and stopdaemon [bluewavenet]
  * Fix - Increase buffer length for longer interface names [koivunen]
  * Add - Update README.md [bluewavenet]
  * Add - bucket ratio option to config file [bluewavenet]
  * Add - upload and download bucket ratio config values [bluewavenet]
  * Fix - flag initial debuglevel to externals [bluewavenet]
  * Add - limit-burst tuning to rate quotas [bluewavenet]
  * Fix - add trailing space to defaultip [bluewavenet]
  * Add - record pre-emptive authentication in local log [bluewavenet]
  * Add - Write to local log function to libopennds [bluewavenet]
  * Add - set client_type and custom string for Pre-emptive authentication [bluewavenet]
  * Fix - Remove trailing newline from library call response [bluewavenet]
  * Fix - attempt to remove cid file only if client->cid is set [bluewavenet]
  * Add - a skip option for custom downloads to speed up serving page from themespec [bluewavenet]
  * Add - put client_type into query string when type is cpd canary [bluewavenet]
  * Add - set refresh=0 before loading images [bluewavenet]
  * Fix - Truncated return status [bluewavenet]
  * Add - Acknowlegement from call to dnsconfig [bluewavenet]
  * Fix - potential buffer overflow in debug output [bluewavenet]
  * Add - processing of custom data and client type [bluewavenet]
  * Add - Client Type for RFC8908 and RFC8910 clients [bluewavenet]
  * Add - rfc8908 replies for external FAS and refactor memory management for MHD calls [bluewavenet]
  * Add - send error 403 if client is not on openNDS subnet [bluewavenet]
  * Fix - remove uneccessary safe_asprint in auth.c [bluewavenet]
  * Fix - Initialise buffer to prevent receiving spurious characters [bluewavenet]
  * Add - encoded custom data support to ndsctl json, themespec and binauth [bluewavenet]
  * Add - advert_1.htm to thankyou page of theme_click-to-continue-custom-placeholders.sh [bluewavenet]
  * Add - library call get_interface_by_ip [bluewavenet]
  * Add - function encode_custom() for encoding custom data to be sent to openNDS [bluewavenet]
  * Fix - error 511, make all html refrences absolute to enforce link to MHD [bluewavenet]
  * Add - check status_path exists and is executeable [bluewavenet]
  * Fix - regression causing error 511 to be served from default script [bluewavenet]
  * Add - venue-info-url and can-extend-session json keys [bluewavenet]
  * Add - RFC 8908 initial experimental support [bluewavenet]
  * Add - debug message when resetting client [bluewavenet]
  * Fix - Ensure the ndscids directory exists before trying to write to it. [bluewavenet]
  * Fix - use eval in do_ndsctl to allow quoting of arguments [bluewavenet]
  * Fix - ensure client hid and client cid file is reset correctly [bluewavenet]
  * Fix - Titles of example ThemeSpec Files [bluewavenet]
  * Fix - Ensure ThemeSpec Files are executable [bluewavenet]
  * Remove - deprecated Allowed and Blocked entries in ndsctl status output [bluewavenet]
  * Add - Deprecate option macmechanism, allowedmaclist and blockedmaclist [bluewavenet]

Signed-off-by: Rob White <rob@blue-wave.net>
2021-12-19 14:00:22 +01:00
Maarten Aertsen
d4622d86bf ohybridproxy: revert to default log level
Change log level from debug to info to avoid filling up syslog with query-level logging.

Signed-off-by: Maarten Aertsen <spam-github@rtsn.nl>
(cherry picked from commit 4f235865e7)
2021-12-08 15:52:54 +01:00
Simon Wunderlich
b2a330202a
Merge pull request #758 from ecsv/batadv-for-21.02
openwrt-21.02: batman-adv: Prevent use from libc headers to not build with BIG_ENDIAN
2021-11-28 17:53:16 +01:00
Hendrik Borghorst
47436b04fd batman-adv: Prevent use from libc headers to not build with BIG_ENDIAN
Commit 97d35a552ec5b6ddf7923dd2f9a8eb973526acea of musl introduced the
macros __LITTLE_ENDIAN and __BIG_ENDIAN in alltypes.h. These are pulled
into the compilation of batman-adv. This has the side effect that the
function is_multicast_ether_addr of etherdevice.h in Linux kernel is
compiled as the big endian version and so fails to work properly on
little endian devices.

This commits prevents pulling in header files of musl libc similar to
OpenWRT commit 9ac47ee46918c45b91f4e4d1fa76b1e26b9d57fe

Signed-off-by: Hendrik Borghorst <hendrikborghorst@gmail.com>
(cherry picked from commit 523821c195)
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-11-27 15:16:12 +01:00
Simon Wunderlich
da7d7a0255
Merge pull request #751 from ecsv/batadv-for-21.02
openwrt-21.02: batman-adv: Merge bugfixes from 2021.4
2021-11-19 17:54:43 +01:00
Sven Eckelmann
6d10a01dfa batman-adv: Merge bugfixes from 2021.4
* fix error handling during interface initialization

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-11-19 17:05:03 +01:00
Nick Hainke
3336ecd33c naywatch: warn user
Naywatch in combination with the watchdog can be tricky and dangerous
when doing a sysupgrade. Add a warning to always stop naywatch first and
check if procd took control over the watchdog again.

Also change use_watchdog to '0'.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-11-15 19:57:06 +01:00
Nick Hainke
9e7698f20d babeld: remove unnecessray blob_buf_init calls
For some reason the buffer is initialized twice before filling it.
This does not break anything but is useless. Reduce the initialization
to only one.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 2cf253b3df)
2021-10-21 01:48:04 +02:00
Nick Hainke
c524118d29 babeld: free blob-buffers that are on stack
As Felix mentioned:
If a buffer was already allocated, blob_buf_init reuses it. You can
keep reusing it as many times as you want. You only need to call
blob_buf_free if you explicitly want to free the buffer memory
(e.g. on exit, or if the blob_buf is on stack).

http://lists.openwrt.org/pipermail/openwrt-devel/2021-October/036722.html

This PR frees the blob-buffers that are on the stack.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 6d463ca97c)
2021-10-16 13:28:38 +02:00
Perry Melange
1fcda9dfa8 olsrd: wait for wireless to initialize before starting
Wait for wireless to initialize (pending="false") to ensure
that any olsrd(6) configured interfaces and their associated
devices are up.  This provides the init script the ability
to properly add all interface sections to the generated
config file /tmp/etc/olsrd(6).conf

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
(cherry picked from commit 0bb6aa04f6)
2021-10-13 11:35:31 +02:00
Nick Hainke
d8b4457267 naywatch: fix procd handling
Sometimes, naywatch can not handover the watchdog to procd again using
ubus. We need to call the same ubus command multiple times until procd
takes over control again.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit e35255710b)
2021-10-01 12:12:47 +02:00
Rob White
c30b5d5df3 opennds: Release v9.4.0 (for 21.02)
Maintainer: Rob White rob@blue-wave.net
Compile tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, gl-inet b1300, gl-inet mt300n-v2, Snapshot, 21.02.0, 19.07.8

Description:
This version adds new functionality, and fixes some issues
  * Add - Error message in fas-aes-https if shared key is mismatched [bluewave.net]
  * Fix - and refactor error 511 page generation[bluewave.net]
  * Fix - and refactor dnsmasq configuration [bluewave.net]
  * Fix - Typographic error preventing RFC8910 disable [bluewave.net]
  * Add - gateway address and gatewayfqdn to ndsctl json output [bluewave.net]
  * Add - RFC8910 housekeeping on startup and shutdown [bluewave.net]
  * Add - correctly apply dhcp option 114 for generic Linux [bluewave.net]
  * Add - reading of configured ndsctlsocket in ndsctl utility[bluewave.net]
  * Add - use send_error 200 for MHD watchdog [bluewave.net]
  * Add - generation of page_511 html by library script [bluewave.net]
  * Add - extend debuglevel support to library scripts [bluewave.net]
  * Refactor - fas-aes-https to simplify and make customisation of http easier [bluewave.net]
  * Add - library script for error 511 page, allowing customisation [bluewave.net]
  * Add - make authmon report connection error details [bluewave.net]
  * Fix- remove unwanted debug message in ndsctl [bluewave.net]
  * Add - RFC8910 support by default [bluewave.net]
  * Add - display status page when accessing /login when authenticated [bluewave.net]
  * Add - MHD response to RFC8910 requests [bluewave.net]
  * Add - Dnsmasq RFC8910 configuration [bluewave.net]
  * Add - send error 511 in response to unsupported http method [bluewave.net]
  * Add - Check for ca-bundle on OpenWrt, if not installed, add syslog messages and terminate [bluewave.net]
  * Add - Make ndsctl use the configured value for socket path if set and deprecate -s option [bluewave.net]
  * Add - Warning message when Walled Garden port 80 is allowed [bluewave.net]
  * Fix - remove un-needed pthread_kill in termination_handler() [bluewave.net] [T-X]
  * Fix - debug messages from authmon.sh [bluewave.net]
  * Fix - Allow disabling gateway fqdn, facilitating access to router port 80 [bluewave.net]
  * Fix - Segfault in ndsctl when -s option is used incorrectly [bluewave.net] [T-X]
  * Fix - Typo making calculation of ul/dl rates incorrect [bluewave.net]
  * Fix - Allow port 80 to be configured in the Walled Garden [bluewave.net]

Signed-off-by: Rob White <rob@blue-wave.net>
2021-09-24 15:34:00 +02:00
Simon Wunderlich
c30c9ffc93
Merge pull request #717 from ecsv/batadv-for-21.02
openwrt-21.02: batman-adv: Merge bugfixes from 2021.2
2021-08-20 22:46:42 +02:00
Sven Eckelmann
e294a22464 batman-adv: Refresh patches with quilt
The test builds are now requiring quilt refreshed patches instead of git
patches. Otherwise the build check will not even try to build something.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-08-20 12:35:52 +02:00
Sven Eckelmann
519ef4ad29 batman-adv: Merge bugfixes from 2021.2
* Avoid WARN_ON timing related checks

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-08-20 12:35:52 +02:00
Nick Hainke
8d93475e79 olsrd: add filtergw plugin
The plugin adds a possibility to filter out gateway HNAs. This can be
very handy e.g. for faulty nodes. A gateway can be taken out directly on
a central node and all traffic is then redirected. Also the underlying
smart gateways are adapted. Currently the link multiplier is often used
to control a faulty node, but it is not necessarily the best way to do
so.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit bdec65a6d9)
2021-08-14 14:45:44 +02:00
Nick Hainke
76a7bc7555 olsrd: update to 2021-06-21
- filtergw: add plugin allow to allow/block gateways
    (even smartgateway)

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit a302ee6265)
2021-08-14 14:45:44 +02:00
Nick Hainke
3912935ab1 olsrd: use SPDX
Use SPDX license headers to be machine readable.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 1326a6c252)
2021-08-14 14:45:44 +02:00
Matt Reeve
69e2fe6651 bird2: Fix bus error on OSPF on IPQ806X
On a Netgear R7800, if ospf v2 or v3 is configured in bird.conf, it fails to start with this error:

Fri Jun 11 14:41:11 2021 daemon.info bird: Started
Fri Jun 11 14:41:11 2021 kern.err kernel: [ 3500.853248] Alignment trap: not handling instruction f44c0a1f at [<00035848>] Fri Jun 11 14:41:11 2021 kern.alert kernel: [ 3500.853283] 8<--- cut here ---
Fri Jun 11 14:41:11 2021 kern.alert kernel: [ 3500.859363] Unhandled fault: alignment exception (0x801) at 0x007e0624
Fri Jun 11 14:41:11 2021 kern.alert kernel: [ 3500.862443] pgd = 0bbef4fd
Fri Jun 11 14:41:11 2021 kern.alert kernel: [ 3500.868821] [007e0624] *pgd=5d6ca835, *pte=5c40b75f, *ppte=5c40bc7f

The problem is due to a struct not being properly aligned on the ARMv7 architecture.

This patch fixes the problem by adding the "PACKED" macro to the affected struct. Note
that upstream may later fix this in another way, in which case this patch will not be required.

Signed-off-by: Matt Reeve <matt@mreeve.com>
2021-08-11 16:17:26 +02:00
Rob White
79a8e562a3 opennds: Release v9.3.0
Maintainer: Rob White rob@blue-wave.net
Compile tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, gl-inet b1300, gl-inet mt300n-v2, Snapshot, 21.02.0-rc3, 19.07.7

Description:
This version adds new functionality, and fixes some issues
  * Add - firewall passthrough mode for authenticated users [bluewave.net]
  * Add - use configured debuglevel in authmon [bluewave.net]
  * Add - automated log rotation and client_zone to binauth_log [bluewave.net]
  * Add - increased timeout interval for file downloads [bluewave.net]
  * Add - local interface to MeshZone and remove unneeded call to ip utility [bluewave.net]
  * Add - log_mountpoint and max_log_entries options [bluewave.net]
  * Add - config variables ext_interface and ext_gateway [bluewave.net]
  * Add - Start initial download of remotes only if online [bluewave.net]
  * Add - Router online/offline watchdog [bluewave.net]
  * Fix - Segfault when gatewayfqdn is disabled [bluewave.net]
  * Fix - missing clientmac when not using themespec [bluewave.net]
  * Fix - some compiler warnings [bluewave.net]
  * Fix - use configured value for webroot for remote image symlink to images folder [bluewave.net]
  * Fix - remove refrences to login.sh in documentation and comments [bluewave.net]
  * Fix - Prevent potential read overrun within the MHD page buffer [bluewave.net]
  * Remove - legacy get_ext_iface() function [bluewave.net]

Signed-off-by: Rob White <rob@blue-wave.net>
2021-08-09 17:07:40 +02:00
Nick Hainke
52aaf9052a naywatch: add naywatch
The network may crash on the SoCs, but the SoC itself does not. This
leads to a node no longer being accessible in a mesh network.  If the
node is placed in a location that is not easily accessible, e.g. in a
high tower, it can cause a lot of problems. Therefore we check the
link-local connectivity on the configured interfaces.

Signed-off-by: Nick Hainke <vincent@systemli.org>
Tested-by: Simon Polack <spolack+git@mailbox.org>
Signed-off-by: Simon Polack <spolack+git@mailbox.org>
(cherry picked from commit 1088e65440)
2021-08-01 22:10:59 +02:00
Nick Hainke
e7e25b873b olsrd: rename general to procd
It was requested to name the section "procd".

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 87be9afac6)
2021-08-01 11:28:27 +02:00
Nick Hainke
e93c57981d olsrd: make respawn_threshold configurable
Also make respawn_threshold configurable. Further, add default
values for:
- respawn_threshold 3600
- respawn_timeout 15
- respawn_retry 0

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 775d030a58)
2021-08-01 11:28:27 +02:00
Tobias Schwarz
0eb67d72d0 olsrd: improve respawn settings
This increases the amount of seconds to wait before a service restart
attempt from 5 to 15 seconds and allows unlimited retries. Olsrd
sometimes crashes together with a network interface and 5 seconds can
be too short to bring back up a crashed network interface, which is
required for olsrd to restart. It also adds the ability to configure
the wait time (respawn_timeout) and the number of retries
(respawn_retry).

Signed-off-by: Tobias Schwarz <info@tobias-schwarz.com>
(cherry picked from commit bc58bd99e8)
2021-08-01 11:28:27 +02:00
Rob White
0e24192903 opennds: [21.02] Backport of Release v9.2.0
Maintainer: Rob White rob@blue-wave.net
Compile tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, gl-inet b1300, gl-inet mt300n-v2, Snapshot, 21.02.0-rc3, 19.07.7

Description:
This version adds new functionality, improves performance, adds documentation and fixes an issue
  * Add - new config options to ndsctl status [bluewave.net]
  * Add - Readthedocs / man documentation for configuration options [bluewave.net]
  * Add - Faster convergence of average rates to configured rate quotas [bluewave.net]
  * Add - BinAuth parse authenticated client database for client data [bluewave.net]
  * Add - Use heap allocation for http page buffer allowing large page sizes [bluewave.net]
  * Fix - fail to serve downloaded images on custom themespec [bluewave.net]

Signed-off-by: Rob White <rob@blue-wave.net>
2021-07-15 11:44:34 +02:00
Martin Hübner
c53a640e44 olsrd: add olsrd-neigh.sh
This script originates from Freifunk Berlin. It prints a list of
all meshing neighbors known to olsrd on the command line.

Added: Error-checking for IPv4/IPv6-Hosts.

Signed-off-by: Martin Hübner <martin.hubner@web.de>
(cherry picked from commit eff944874c)
2021-07-11 19:53:11 +02:00
Nick Hainke
911c0cb45a olsrd: fix olsrd starting before network
Should fix #691.

Sometimes the wifi interface is not ready before olsrd tries to access
it. This leads to warnings in the form of:

daemon.info olsrd: /etc/rc.d/S65olsrd: olsrd_write_interface()
	Warning: Interface 'wireless0' not found, skipped
daemon.notice procd: /etc/rc.d/S65olsrd: olsrd: /etc/rc.d/S65olsrd:
	olsrd_write_interface() Warning: Interface 'wireless0' not found,			skipped

We make use of the "wait_for" procd command that allows us to wait for
the network before starting olsrd.

Tested-by: Noki
Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-07-07 14:56:57 +02:00
Rob White
5a09ac1180 opennds: [21.02] Backport of Release v9.1.1
Maintainer: Rob White rob@blue-wave.net
Compile tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc
Run tested: arm_cortex-a7_neon-vfpv4, mipsel_24kc, gl-inet b1300, gl-inet mt300n-v2, Snapshot, 21.02.0-rc3, 19.07.7

Description:
This version fixes a compiler error, some compiler warnings and mutes a debug message
  * Fix - Compiler error, missing mode in call to open() [bluewave.net]
  * Fix - Compiler warning, ignored return value from call to lockf() [bluewave.net]
  * Fix - Compiler warning, ignored return value from call to system() [bluewave.net]
  * Fix - Compiler warning, ignored return value from call to fgets() [bluewave.net]
  * Fix - Remove debug message from call to get_client_interface library [bluewave.net]

Signed-off-by: Rob White <rob@blue-wave.net>
2021-07-06 10:11:27 +02:00
Nick Hainke
ce4d4578c7 olsrd: reload if config changed via uci
Fixes:
https://github.com/openwrt/luci/issues/5139

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 64aa8866b7)
2021-06-23 16:31:27 +02:00
Nick Hainke
2baff33918 olsrd: switch to procd
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit dc0adf7dce)
2021-06-12 16:37:24 +02:00
Paul Spooren
9f74c2cc41 README: update content and use Markdown
The repository path changed and the information to manually add the feed
is outdated, since it enabled by default.

Also use Markdown to format the README since it looks much more
appealing.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 4bf9a5d5dc)
2021-06-11 11:05:40 -10:00
Nick Hainke
79c5c33d48 babeld: add me as maintainer
I am maintaining the ubus bindings and also the luci-app-babeld.
I am very glad that ubus is included and that is why I do not want
babeld maintainer to have extra work.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit e62b8b54b9)
2021-06-10 09:23:40 +02:00
Nick Hainke
c9bb4d3ebe babeld: update to 1.10
25 April 2021: babeld-1.10
  * Removed the disambiguation code: source-specific routing is no longer
    supported for IPv4, and for IPv6 only on Linux 3.11 or later.
  * Fixed an issue handling of retractions with no next hop, which caused
    interoperability problems with BIRD.  Thanks to Fabian Bläse.
  * If skip-kernel-setup is set, we no longer disable the rp_filter, which
    makes babeld work in containers.  Thanks to Martin Weinelt.

Remove upstreamed part of ubus patch:
-  local: make local_kind function accessible

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit dc22d38f91)
2021-06-10 09:23:40 +02:00
Nick Hainke
13461119bc olsrd: only pud depends on libgps
As a workaround for the glibc-fix the dependency on libgps was moved
to olsrd. However, only pud is using this library.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 27ac56adc6)
2021-06-08 22:21:51 +02:00
Nick Hainke
96ba5d184a olsrd: update to 2021-06-07
- pud: fix openwrt glibc compilation

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 4f7791a1fd)
2021-06-08 22:21:51 +02:00
Nick Hainke
f1f523117f olsrd: update olsrd to 2021-06-01
Update olsrd to new version.
Remove upstreamed patches:
- 010-musl.patch
- 011-bison.patch
- 012-gpsd.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 6dac4d296c)
2021-06-08 22:21:51 +02:00
Nick Hainke
435ae43565 olsrd: add me as maintainer
I am now the maintainer of olsrd. Add me also as maintainer in the
openwrt-routing feed.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit b455e1809a)
2021-06-08 22:21:51 +02:00
Nick Hainke
60874ceb56 olsrd: use $(AUTORELEASE)
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 8c7bcb7206)
2021-06-08 22:21:51 +02:00
Nick Hainke
fd950266f9 CI: fix building multi-arch-test-build
The sed is adding the package name as "PKGNAME/" and does not remove
the "/". That is why the buildchain currently fails.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-06-08 20:38:50 +02:00
Nick Hainke
13fce79c38 CI: copy .github from openwrt-packages
Just copy .github from openwrt enabling:
- checking of formalities
- checking of build
- issue template
- pr template

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit d1ab87b7db)
2021-06-08 20:38:50 +02:00
Simon Wunderlich
57533a25e8
Merge pull request #659 from ecsv/batadv-for-21.02
openwrt-21.02: update packages to version 2021.1
2021-05-19 08:35:37 +02:00
Sven Eckelmann
7f259642fb alfred: update to version 2021.1
* Allow to force of alfred startup when the interfaces don't work/exist (yet)
* coding style cleanups and refactoring

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-18 19:18:08 +02:00
Sven Eckelmann
511211431b batctl: update to version 2021.1
* add various commands to print generic netlink replies as JSON
* coding style cleanups and refactoring

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-18 19:17:38 +02:00
Sven Eckelmann
5d09821ed7 batman-adv: Always send iface index+name in genlmsg
The batman-adv netlink messages often contain the interface index and
interface name in the same message. This makes it easy for the receiver to
operate on the incoming data when it either needs to print something or
needs to operate on the interface index.

But one of the attributes was missing for:

* neighbor table dumps
* originator table dumps
* gateway list dumps
* query of hardif information
* query of vid information

The userspace therefore had to implement special workarounds using
SIOCGIFNAME or SIOCGIFINDEX depending on what was actually provided.
Providing both information simplifies the userspace code massively without
adding a lot of extra overhead in the kernel portion.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-18 19:17:19 +02:00
Sven Eckelmann
9c2452c407 batman-adv: update to version 2021.1
* support latest kernels (4.4 - 5.13)
* coding style cleanups and refactoring
* bugs squashed:

  - correctly initialize padding when sending out translation table TVLVs

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-18 19:17:06 +02:00
Simon Wunderlich
0fc85a4b73
Merge pull request #657 from ecsv/batadv-for-21.02
openwrt-21.02: batman-adv: Merge bugfixes from 2021.1
2021-05-18 19:09:31 +02:00
Sven Eckelmann
9beb55d8fc batman-adv: Merge bugfixes from 2021.1
* initialize "struct batadv_tvlv_tt_vlan_data"->reserved field

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-14 20:54:45 +02:00
Sven Eckelmann
e7ea594077 alfred: use $(AUTORELEASE) for PKG_RELEASE
Use `$(AUTORELEASE)` variable rather than setting a PKG_RELEASE
on every commit manually.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-14 20:05:24 +02:00
Sven Eckelmann
7f513574e4 batctl: use $(AUTORELEASE) for PKG_RELEASE
Use `$(AUTORELEASE)` variable rather than setting a PKG_RELEASE
on every commit manually.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-14 20:05:24 +02:00
Sven Eckelmann
3f06277b92 batman-adv: use $(AUTORELEASE) for PKG_RELEASE
Use `$(AUTORELEASE)` variable rather than setting a PKG_RELEASE
on every commit manually.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-14 20:05:24 +02:00
rob
126720145b opennds: Release v9.0.0
This version introduces major new functionality, some changes and fixes.

New Themed Splash pages are introduced, enabling rapid customisation. Theme placeholders can be populated from information provided in the config file. Remote files and image sources can be defined in the config file and these will be automatically downloaded as required.

Deprecated legacy code from previous versions has been removed.

Tested on OpenWrt, OpenSuse and Debian.

Signed-off-by: rob <rob@blue-wave.net>
2021-05-14 11:44:06 +02:00
Josef Schlehofer
5b4d4c7fb6 bird2: Makefile polishing
- Just small reodering of some rows to be more consistent with packages feed
- Fix deprecated SPDX License Identifier

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit b38a46acd5)
2021-04-02 10:32:26 +02:00
Josef Schlehofer
08903b9418 bird2: update to version 2.0.8
- Removed all patches as they are now included in upstream release
- Removed --with-linux-headers option
(Fixes: configure: WARNING: unrecognized options: --with-linux-headers)

Changelog:
https://bird.network.cz/pipermail/bird-users/2021-March/015281.html

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit dcff996cbe)
2021-04-02 10:32:26 +02:00
Rob White
6f29856e60 opennds: Release 8.1.1
This release fixes an issue where some firewall rules containing
the keyword "block" would cause openNDS to fail in startup.

Signed-off-by: Rob White <rob@blue-wave.net>
2021-02-22 22:06:41 +01:00
97 changed files with 6875 additions and 1040 deletions

16
.github/issue_template vendored Normal file
View file

@ -0,0 +1,16 @@
Please make sure that the issue subject starts with `<package-name>: `
Also make sure that the package is maintained in this repository and not in base which should be submitted at https://bugs.openwrt.org or in the LuCI repository which should be submitted at https://github.com/openwrt/luci/issues.
Issues related to releases below 18.06 and forks are not supported or maintained and will be closed.
# Issue template (remove lines from top till here)
Maintainer: @\<github-user> (find it by checking history of the package Makefile)
Environment: (put here arch, model, OpenWrt version)
Description:
```
Formating code blocks by wrapping them with pairs of ```
```

5
.github/pull_request_template vendored Normal file
View file

@ -0,0 +1,5 @@
Maintainer: me / @\<github-user> (find it by checking history of the package Makefile)
Compile tested: (put here arch, model, OpenWrt version)
Run tested: (put here arch, model, OpenWrt version, tests done)
Description:

6
.github/workflows/Dockerfile vendored Normal file
View file

@ -0,0 +1,6 @@
ARG ARCH=x86-64
FROM openwrt/rootfs:$ARCH
ADD entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]

26
.github/workflows/ci_helpers.sh vendored Normal file
View file

@ -0,0 +1,26 @@
#!/bin/sh
color_out() {
printf "\e[0;$1m$PKG_NAME: %s\e[0;0m\n" "$2"
}
success() {
color_out 32 "$1"
}
info() {
color_out 36 "$1"
}
err() {
color_out 31 "$1"
}
warn() {
color_out 33 "$1"
}
err_die() {
err "$1"
exit 1
}

48
.github/workflows/entrypoint.sh vendored Executable file
View file

@ -0,0 +1,48 @@
#!/bin/sh
# not enabling `errtrace` and `pipefail` since those are bash specific
set -o errexit # failing commands causes script to fail
set -o nounset # undefined variables causes script to fail
echo "src/gz packages_ci file:///ci" >> /etc/opkg/distfeeds.conf
FINGERPRINT="$(usign -F -p /ci/packages_ci.pub)"
cp /ci/packages_ci.pub "/etc/opkg/keys/$FINGERPRINT"
mkdir -p /var/lock/
opkg update
[ -n "${CI_HELPER:=''}" ] || CI_HELPER="/ci/.github/workflows/ci_helpers.sh"
for PKG in /ci/*.ipk; do
tar -xzOf "$PKG" ./control.tar.gz | tar xzf - ./control
# package name including variant
PKG_NAME=$(sed -ne 's#^Package: \(.*\)$#\1#p' ./control)
# package version without release
PKG_VERSION=$(sed -ne 's#^Version: \(.*\)-[0-9]*$#\1#p' ./control)
# package source contianing test.sh script
PKG_SOURCE=$(sed -ne 's#^Source: .*/\(.*\)$#\1#p' ./control)
echo "Testing package $PKG_NAME in version $PKG_VERSION from $PKG_SOURCE"
opkg install "$PKG"
export PKG_NAME PKG_VERSION CI_HELPER
TEST_SCRIPT=$(find /ci/ -name "$PKG_SOURCE" -type d)/test.sh
if [ -f "$TEST_SCRIPT" ]; then
echo "Use package specific test.sh"
if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then
echo "Test succesful"
else
echo "Test failed"
exit 1
fi
else
echo "No test.sh script available"
fi
opkg remove "$PKG_NAME" --force-removal-of-dependent-packages --force-remove
done

63
.github/workflows/formal.yml vendored Normal file
View file

@ -0,0 +1,63 @@
name: Test Formalities
on:
pull_request:
jobs:
build:
name: Test Formalities
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Determine branch name
run: |
BRANCH="${GITHUB_BASE_REF#refs/heads/}"
echo "Building for $BRANCH"
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- name: Test formalities
run: |
source .github/workflows/ci_helpers.sh
RET=0
for commit in $(git rev-list HEAD ^origin/$BRANCH); do
info "=== Checking commit '$commit'"
if git show --format='%P' -s $commit | grep -qF ' '; then
err "Pull request should not include merge commits"
RET=1
fi
author="$(git show -s --format=%aN $commit)"
if echo $author | grep -q '\S\+\s\+\S\+'; then
success "Author name ($author) seems ok"
else
err "Author name ($author) need to be your real name 'firstname lastname'"
RET=1
fi
subject="$(git show -s --format=%s $commit)"
if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then
success "Commit subject line seems ok ($subject)"
else
err "Commit subject line MUST start with '<package name>: ' ($subject)"
RET=1
fi
body="$(git show -s --format=%b $commit)"
sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
if echo "$body" | grep -qF "$sob"; then
success "Signed-off-by match author"
else
err "Signed-off-by is missing or doesn't match author (should be '$sob')"
RET=1
fi
done
exit $RET

View file

@ -0,0 +1,150 @@
name: Test Build
on:
pull_request:
jobs:
build:
name: Test ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: arc_archs
target: archs38-generic
runtime_test: false
- arch: arm_cortex-a9_vfpv3-d16
target: mvebu-cortexa9
runtime_test: false
- arch: mips_24kc
target: ath79-generic
runtime_test: false
- arch: powerpc_464fp
target: apm821xx-nand
runtime_test: false
- arch: powerpc_8540
target: mpc85xx-p1010
runtime_test: false
- arch: aarch64_cortex-a53
target: mvebu-cortexa53
runtime_test: true
- arch: arm_cortex-a15_neon-vfpv4
target: armvirt-32
runtime_test: true
- arch: i386_pentium-mmx
target: x86-geode
runtime_test: true
- arch: x86_64
target: x86-64
runtime_test: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine branch name
run: |
BRANCH="${GITHUB_BASE_REF#refs/heads/}"
echo "Building for $BRANCH"
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- name: Determine changed packages
run: |
# only detect packages with changes
PKG_ROOTS=$(find . -name Makefile | \
grep -v ".*/src/Makefile" | \
sed -e 's@./\(.*\)/Makefile@\1/@')
CHANGES=$(git diff --diff-filter=d --name-only origin/$BRANCH)
for ROOT in $PKG_ROOTS; do
for CHANGE in $CHANGES; do
if [[ "$CHANGE" == "$ROOT"* ]]; then
PACKAGES+=$(echo "$ROOT" | sed -e 's@\(.*\)/@\1 @')
break
fi
done
done
# fallback to test packages if nothing explicitly changes this is
# should run if other mechanics in packages.git changed
PACKAGES="${PACKAGES:-bird2 cjdns olsrd}"
echo "Building $PACKAGES"
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
- name: Generate build keys
run: |
sudo apt-get install -y signify-openbsd
signify-openbsd -G -n -c 'DO NOT USE - OpenWrt packages feed CI' -p packages_ci.pub -s packages_ci.sec
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "KEY_BUILD<<$EOF" >> $GITHUB_ENV
cat packages_ci.sec >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
- name: Build
uses: openwrt/gh-action-sdk@v5
env:
ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
FEEDNAME: packages_ci
INDEX: 1
KEY_BUILD: ${{ env.KEY_BUILD }}
- name: Move created packages to project dir
run: cp bin/packages/${{ matrix.arch }}/packages_ci/* . || true
- name: Store packages
uses: actions/upload-artifact@v3
with:
name: ${{env.ARCHIVE_NAME}}-packages
path: |
Packages
Packages.*
*.ipk
PKG-INFO
- name: Store logs
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.arch}}-logs
path: logs/
- name: Remove logs
run: sudo rm -rf logs/ || true
- name: Check if any packages were built
run: |
if [ -n "$(find . -maxdepth 1 -type f -name '*.ipk' -print -quit)" ]; then
echo "Found *.ipk files"
HAVE_IPKS=true
else
echo "No *.ipk files found"
HAVE_IPKS=false
fi
echo "HAVE_IPKS=$HAVE_IPKS" >> $GITHUB_ENV
- name: Register QEMU
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
run: |
sudo docker run --rm --privileged aptman/qus -s -- -p
- name: Build Docker container
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
run: |
docker build -t test-container --build-arg ARCH .github/workflows/
env:
ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
- name: Test via Docker container
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
run: |
docker run --rm -v $GITHUB_WORKSPACE:/ci test-container

18
README
View file

@ -1,18 +0,0 @@
This is an OpenWrt package feed containing community maintained routing packages.
To use these packages, add the following line to the feeds.conf
in the OpenWrt buildroot:
src-git routing git://github.com/openwrt-routing/packages.git
Update the feed:
./scripts/feeds update routing
Activate the package:
./scripts/feeds install -a -p routing
The routing packages should now appear in menuconfig.

21
README.md Normal file
View file

@ -0,0 +1,21 @@
# OpenWrt Routing Feed
## Description
This OpenWrt package feed contains community maintained routing packages.
## Usage
This repository is intended to be layered on-top of an OpenWrt buildroot.
If you do not have an OpenWrt buildroot installed, see the documentation at:
[OpenWrt Buildroot Installation][1] on the OpenWrt support site.
This feed is enabled by default. To install all its package definitions, run:
```
./scripts/feeds update routing
./scripts/feeds install -a -p routing
```
[1]: https://openwrt.org/docs/guide-developer/build-system/install-buildsystem

View file

@ -3,17 +3,25 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=alfred PKG_NAME:=alfred
PKG_VERSION:=2021.0 PKG_VERSION:=2021.1
PKG_RELEASE:=3 PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_HASH:=a062c08da21e0a23ae0554d392c8147dfd2129ae6975a7f5004dc680fee2244b PKG_HASH:=94e2cf4dad885f9059fc8b8694a71eca51c9e184683bb99a79e3de8cb7485e88
PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de> PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
PKG_LICENSE:=GPL-2.0-only MIT PKG_LICENSE:=GPL-2.0-only MIT
PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT
PKG_CONFIG_DEPENDS += \
CONFIG_ALFRED_NEEDS_lua \
CONFIG_ALFRED_NEEDS_libgps \
CONFIG_PACKAGE_ALFRED_VIS \
CONFIG_PACKAGE_ALFRED_BATHOSTS \
CONFIG_PACKAGE_ALFRED_GPSD
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/alfred define Package/alfred

View file

@ -0,0 +1,22 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 19 Feb 2022 08:51:28 +0100
Subject: alfred: Ensure processed change_iface packet is 0-terminated
A client sending a alfred_change_interface_v0 packet to the alfred server
might have forgotten to 0-terminate the string. In this case, strstr in
unix_sock_change_iface might read outside of the available buffer.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/alfred.git/commit/d2d27e4b9d697928d21dfa5c79908618ef8b56ac
--- a/unix_sock.c
+++ b/unix_sock.c
@@ -329,6 +329,8 @@ unix_sock_change_iface(struct globals *g
if (len < (int)(sizeof(*change_iface) - sizeof(change_iface->header)))
goto err;
+ change_iface->ifaces[sizeof(change_iface->ifaces) - 1] = '\0';
+
if (globals->opmode == OPMODE_SECONDARY) {
if (strstr(change_iface->ifaces, ",") != NULL) {
ret = -EINVAL;

View file

@ -1,29 +0,0 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Mon, 15 Feb 2021 19:56:22 +0100
Subject: alfred: Show error message for invalid batadv interface
The alfred server process always stopped without any informational message
when the provided batman-adv was not "none" and was not accessible. This
made it extremely hard to debug the reason why alfred directly stopped
after launching it.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-1-sven@narfation.org/
diff --git a/server.c b/server.c
index fc27246b845af75bd1f459f8bb553aef87cc24d5..efac5ad399df52f8c444711a14bcf4814e38a3bf 100644
--- a/server.c
+++ b/server.c
@@ -385,8 +385,11 @@ int alfred_server(struct globals *globals)
}
if (strcmp(globals->mesh_iface, "none") != 0 &&
- batadv_interface_check(globals->mesh_iface) < 0)
+ batadv_interface_check(globals->mesh_iface) < 0) {
+ fprintf(stderr, "Can't start server: batman-adv interface %s not found\n",
+ globals->mesh_iface);
return -1;
+ }
num_socks = netsock_open_all(globals);
if (num_socks <= 0) {

View file

@ -1,72 +0,0 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Mon, 15 Feb 2021 20:16:15 +0100
Subject: alfred: Allow exactly one interface for secondary mode
A primary alfred daemon allows syncing over more than one interface. But
the secondary alfred daemon needs exactly one interface. But the check for
this property was insufficient because it allowed paramters like
"-i wlan0,asd" when wlan0 is valid and asd is not valid.
The better solution is to really use the number of interfaces given to
alfred instead of the number of interfaces evaluated as "valid".
Fixes: 67ae5f57eedd ("alfred: Add support for multiple interfaces per master")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-2-sven@narfation.org/
diff --git a/alfred.h b/alfred.h
index 1e2c05835cbfba02ebabefe55afc29f7ef8e12b1..7d6b0b35b5c8b8c3b087589880c390eb035584be 100644
--- a/alfred.h
+++ b/alfred.h
@@ -182,6 +182,7 @@ int unix_sock_req_data_finish(struct globals *globals,
int vis_update_data(struct globals *globals);
/* netsock.c */
int netsock_open_all(struct globals *globals);
+size_t netsocket_count_interfaces(struct globals *globals);
void netsock_close_all(struct globals *globals);
int netsock_set_interfaces(struct globals *globals, char *interfaces);
struct interface *netsock_first_interface(struct globals *globals);
diff --git a/netsock.c b/netsock.c
index 367b20730500a1c24448200a24149b64059f3381..84b0ec3827e491eead997f58b2b8f26c5b18b843 100644
--- a/netsock.c
+++ b/netsock.c
@@ -471,6 +471,17 @@ int netsock_open_all(struct globals *globals)
return num_socks;
}
+size_t netsocket_count_interfaces(struct globals *globals)
+{
+ struct interface *interface;
+ size_t count = 0;
+
+ list_for_each_entry(interface, &globals->interfaces, list)
+ count++;
+
+ return count;
+}
+
void netsock_reopen(struct globals *globals)
{
struct interface *interface;
diff --git a/server.c b/server.c
index efac5ad399df52f8c444711a14bcf4814e38a3bf..eb2bc8aeb787e4bf028c8f9e3a523a18c6992be1 100644
--- a/server.c
+++ b/server.c
@@ -371,6 +371,7 @@ int alfred_server(struct globals *globals)
int maxsock, ret, recvs;
struct timespec last_check, now, tv;
fd_set fds, errfds;
+ size_t num_interfaces;
int num_socks;
if (create_hashes(globals))
@@ -397,7 +398,8 @@ int alfred_server(struct globals *globals)
return -1;
}
- if (num_socks > 1 && globals->opmode == OPMODE_SECONDARY) {
+ num_interfaces = netsocket_count_interfaces(globals);
+ if (num_interfaces > 1 && globals->opmode == OPMODE_SECONDARY) {
fprintf(stderr, "More than one interface specified in secondary mode\n");
return -1;
}

View file

@ -1,67 +0,0 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Mon, 15 Feb 2021 20:34:54 +0100
Subject: alfred: Save global mode flags in bitfield
The verbose and ipv4mode entries in the globals structure is only used to
save a boolean information. So just use a bit in a bitfield to store this
information instead of a full int.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-3-sven@narfation.org/
diff --git a/alfred.h b/alfred.h
index 7d6b0b35b5c8b8c3b087589880c390eb035584be..c64ff17ab9be8a16b3e1c86070b93235c226a004 100644
--- a/alfred.h
+++ b/alfred.h
@@ -115,8 +115,8 @@ struct globals {
enum clientmode clientmode;
int clientmode_arg;
int clientmode_version;
- int verbose;
- int ipv4mode;
+ uint8_t verbose:1;
+ uint8_t ipv4mode:1;
int unix_sock;
const char *unix_path;
diff --git a/main.c b/main.c
index 7b866cc4275797beb7f614dd1a19ea0099e1281b..f25b6cc11975b8523abf6c59b77a86e94684b03b 100644
--- a/main.c
+++ b/main.c
@@ -9,6 +9,7 @@
#include <arpa/inet.h>
#include <getopt.h>
#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -181,8 +182,8 @@ static struct globals *alfred_init(int argc, char *argv[])
globals->clientmode_version = 0;
globals->mesh_iface = "bat0";
globals->unix_path = ALFRED_SOCK_PATH_DEFAULT;
- globals->verbose = 0;
- globals->ipv4mode = 0;
+ globals->verbose = false;
+ globals->ipv4mode = false;
globals->update_command = NULL;
globals->sync_period.tv_sec = ALFRED_INTERVAL;
globals->sync_period.tv_nsec = 0;
@@ -252,7 +253,7 @@ static struct globals *alfred_init(int argc, char *argv[])
globals->unix_path = optarg;
break;
case 'd':
- globals->verbose++;
+ globals->verbose = true;
break;
case 'c':
globals->update_command = optarg;
@@ -268,7 +269,7 @@ static struct globals *alfred_init(int argc, char *argv[])
printf(" ** Setting sync interval to: %.9f seconds (%ld.%09ld)\n", sync_period, globals->sync_period.tv_sec, globals->sync_period.tv_nsec);
break;
case '4':
- globals->ipv4mode = 1;
+ globals->ipv4mode = true;
inet_pton(AF_INET, optarg, &alfred_mcast.ipv4);
printf(" ** IPv4 Multicast Mode: %x\n", alfred_mcast.ipv4.s_addr);
break;

View file

@ -1,102 +0,0 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Mon, 15 Feb 2021 20:52:17 +0100
Subject: alfred: Allow start of server without valid interface
The alfred server always needs interfaces to operate on. But these
interfaces might not exist at the moment when the daemon process is
started. This caused an error and stopped the process.
But alfred is able to deal with interfaces which disappeared at runtime but
existed at startup. To force a similar behavior for the alfred startup, the
parameter "--force" or "-f" is introduced.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-4-sven@narfation.org/
diff --git a/alfred.h b/alfred.h
index c64ff17ab9be8a16b3e1c86070b93235c226a004..ac082536bd6565756835489194be9b80fe0dd653 100644
--- a/alfred.h
+++ b/alfred.h
@@ -117,6 +117,7 @@ struct globals {
int clientmode_version;
uint8_t verbose:1;
uint8_t ipv4mode:1;
+ uint8_t force:1;
int unix_sock;
const char *unix_path;
diff --git a/main.c b/main.c
index f25b6cc11975b8523abf6c59b77a86e94684b03b..e190d4274a0fe2abdb2c462a5bdefb3e199d4797 100644
--- a/main.c
+++ b/main.c
@@ -164,6 +164,7 @@ static struct globals *alfred_init(int argc, char *argv[])
{"version", no_argument, NULL, 'v'},
{"verbose", no_argument, NULL, 'd'},
{"sync-period", required_argument, NULL, 'p'},
+ {"force", no_argument, NULL, 'f'},
{NULL, 0, NULL, 0},
};
@@ -184,6 +185,7 @@ static struct globals *alfred_init(int argc, char *argv[])
globals->unix_path = ALFRED_SOCK_PATH_DEFAULT;
globals->verbose = false;
globals->ipv4mode = false;
+ globals->force = false;
globals->update_command = NULL;
globals->sync_period.tv_sec = ALFRED_INTERVAL;
globals->sync_period.tv_nsec = 0;
@@ -191,7 +193,7 @@ static struct globals *alfred_init(int argc, char *argv[])
time_random_seed();
- while ((opt = getopt_long(argc, argv, "ms:r:hi:b:vV:M:I:u:dc:p:4:", long_options,
+ while ((opt = getopt_long(argc, argv, "ms:r:hi:b:vV:M:I:u:dc:p:4:f", long_options,
&opt_ind)) != -1) {
switch (opt) {
case 'r':
@@ -273,6 +275,9 @@ static struct globals *alfred_init(int argc, char *argv[])
inet_pton(AF_INET, optarg, &alfred_mcast.ipv4);
printf(" ** IPv4 Multicast Mode: %x\n", alfred_mcast.ipv4.s_addr);
break;
+ case 'f':
+ globals->force = true;
+ break;
case 'h':
default:
alfred_usage();
diff --git a/man/alfred.8 b/man/alfred.8
index 25591be9ece1f8de572be8f639576861e318005f..e965db8260086cc83bc78ad95f97bc368a6cb170 100644
--- a/man/alfred.8
+++ b/man/alfred.8
@@ -72,6 +72,9 @@ Collect data from the network and prints it on the network
\fB\-d\fP, \fB\-\-verbose\fP
Show extra information in the data output
.TP
+\fB\-d\fP, \fB\-\-force\fP
+Start server even when batman-adv or interface(s) are not yet available.
+.TP
\fB\-V\fP, \fB\-\-req\-version\fP \fIversion\fP
Specify the data version set for \fB\-s\fP
diff --git a/server.c b/server.c
index eb2bc8aeb787e4bf028c8f9e3a523a18c6992be1..b4925e7e16ba7465662a5dbf12432916fed8bd03 100644
--- a/server.c
+++ b/server.c
@@ -386,14 +386,15 @@ int alfred_server(struct globals *globals)
}
if (strcmp(globals->mesh_iface, "none") != 0 &&
- batadv_interface_check(globals->mesh_iface) < 0) {
+ batadv_interface_check(globals->mesh_iface) < 0 &&
+ !globals->force) {
fprintf(stderr, "Can't start server: batman-adv interface %s not found\n",
globals->mesh_iface);
return -1;
}
num_socks = netsock_open_all(globals);
- if (num_socks <= 0) {
+ if (num_socks <= 0 && !globals->force) {
fprintf(stderr, "Failed to open interfaces\n");
return -1;
}

View file

@ -8,15 +8,16 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=babeld PKG_NAME:=babeld
PKG_VERSION:=1.9.2 PKG_VERSION:=1.12.2
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/
PKG_HASH:=154f00e0a8bf35d6ea9028886c3dc5c3c342dd1a367df55ef29a547b75867f07 PKG_HASH:=1db22b6193070ea2450a1ab51196fd72f58a1329f780cb0388e2e4b2e7768cbb
PKG_MAINTAINER:=Gabriel Kerneis <gabriel@kerneis.info>, \ PKG_MAINTAINER:=Gabriel Kerneis <gabriel@kerneis.info>, \
Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org> Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>, \
Nick Hainke <vincent@systemli.org>
PKG_LICENSE:=MIT PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENCE PKG_LICENSE_FILES:=LICENCE
@ -36,7 +37,7 @@ define Package/babeld/description
with fast convergence properties. It is based on the ideas in DSDV, AODV and with fast convergence properties. It is based on the ideas in DSDV, AODV and
Cisco's EIGRP, but is designed to work well not only in wired networks but Cisco's EIGRP, but is designed to work well not only in wired networks but
also in wireless mesh networks, and has been extended with support for also in wireless mesh networks, and has been extended with support for
overlay networks. Babel is in the process of becoming an IETF Standard. overlay networks. Babel is an IETF standard protocol (RFC 8966).
endef endef
define Package/babeld/conffiles define Package/babeld/conffiles

View file

@ -1,7 +1,7 @@
--- a/babeld.c --- a/babeld.c
+++ b/babeld.c +++ b/babeld.c
@@ -55,6 +55,8 @@ THE SOFTWARE. @@ -54,6 +54,8 @@ THE SOFTWARE.
#include "rule.h" #include "local.h"
#include "version.h" #include "version.h"
+#include "ubus.h" +#include "ubus.h"
@ -9,7 +9,7 @@
struct timeval now; struct timeval now;
unsigned char myid[8]; unsigned char myid[8];
@@ -536,6 +538,9 @@ main(int argc, char **argv) @@ -521,6 +523,9 @@ main(int argc, char **argv)
} }
} }
@ -19,7 +19,7 @@
init_signals(); init_signals();
rc = resize_receive_buffer(1500); rc = resize_receive_buffer(1500);
if(rc < 0) if(rc < 0)
@@ -635,6 +640,8 @@ main(int argc, char **argv) @@ -616,6 +621,8 @@ main(int argc, char **argv)
FD_SET(local_sockets[i].fd, &readfds); FD_SET(local_sockets[i].fd, &readfds);
maxfd = MAX(maxfd, local_sockets[i].fd); maxfd = MAX(maxfd, local_sockets[i].fd);
} }
@ -28,7 +28,7 @@
rc = select(maxfd + 1, &readfds, NULL, NULL, &tv); rc = select(maxfd + 1, &readfds, NULL, NULL, &tv);
if(rc < 0) { if(rc < 0) {
if(errno != EINTR) { if(errno != EINTR) {
@@ -703,6 +710,9 @@ main(int argc, char **argv) @@ -684,6 +691,9 @@ main(int argc, char **argv)
i++; i++;
} }
@ -38,22 +38,6 @@
if(reopening) { if(reopening) {
kernel_dump_time = now.tv_sec; kernel_dump_time = now.tv_sec;
check_neighbours_timeout = now; check_neighbours_timeout = now;
--- a/Makefile
+++ b/Makefile
@@ -11,11 +11,11 @@ LDLIBS = -lrt
SRCS = babeld.c net.c kernel.c util.c interface.c source.c neighbour.c \
route.c xroute.c message.c resend.c configuration.c local.c \
- disambiguation.c rule.c
+ disambiguation.c rule.c ubus.c
OBJS = babeld.o net.o kernel.o util.o interface.o source.o neighbour.o \
route.o xroute.o message.o resend.o configuration.o local.o \
- disambiguation.o rule.o
+ disambiguation.o rule.o ubus.o
babeld: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o babeld $(OBJS) $(LDLIBS)
--- a/generate-version.sh --- a/generate-version.sh
+++ b/generate-version.sh +++ b/generate-version.sh
@@ -10,4 +10,4 @@ else @@ -10,4 +10,4 @@ else
@ -64,15 +48,16 @@
+echo "#define BABELD_VERSION \"$version-ubus-mod\"" +echo "#define BABELD_VERSION \"$version-ubus-mod\""
--- a/configuration.c --- a/configuration.c
+++ b/configuration.c +++ b/configuration.c
@@ -41,6 +41,7 @@ THE SOFTWARE. @@ -42,6 +42,8 @@ THE SOFTWARE.
#include "kernel.h" #include "hmac.h"
#include "configuration.h" #include "configuration.h"
#include "rule.h"
+#include "ubus.h"
+#include "ubus.h"
+
static struct filter *input_filters = NULL; static struct filter *input_filters = NULL;
static struct filter *output_filters = NULL; static struct filter *output_filters = NULL;
@@ -850,7 +851,8 @@ parse_option(int c, gnc_t gnc, void *clo static struct filter *redistribute_filters = NULL;
@@ -1036,7 +1038,8 @@ parse_option(int c, gnc_t gnc, void *clo
strcmp(token, "daemonise") == 0 || strcmp(token, "daemonise") == 0 ||
strcmp(token, "skip-kernel-setup") == 0 || strcmp(token, "skip-kernel-setup") == 0 ||
strcmp(token, "ipv6-subtrees") == 0 || strcmp(token, "ipv6-subtrees") == 0 ||
@ -82,7 +67,7 @@
int b; int b;
c = getbool(c, &b, gnc, closure); c = getbool(c, &b, gnc, closure);
if(c < -1) if(c < -1)
@@ -868,6 +870,8 @@ parse_option(int c, gnc_t gnc, void *clo @@ -1054,6 +1057,8 @@ parse_option(int c, gnc_t gnc, void *clo
has_ipv6_subtrees = b; has_ipv6_subtrees = b;
else if(strcmp(token, "reflect-kernel-metric") == 0) else if(strcmp(token, "reflect-kernel-metric") == 0)
reflect_kernel_metric = b; reflect_kernel_metric = b;
@ -102,15 +87,6 @@
int local_server_socket = -1; int local_server_socket = -1;
struct local_socket local_sockets[MAX_LOCAL_SOCKETS]; struct local_socket local_sockets[MAX_LOCAL_SOCKETS];
int num_local_sockets = 0; int num_local_sockets = 0;
@@ -80,7 +82,7 @@ write_timeout(int fd, const void *buf, i
}
}
-static const char *
+const char *
local_kind(int kind)
{
switch(kind) {
@@ -191,6 +193,8 @@ local_notify_neighbour(struct neighbour @@ -191,6 +193,8 @@ local_notify_neighbour(struct neighbour
if(local_sockets[i].monitor) if(local_sockets[i].monitor)
local_notify_neighbour_1(&local_sockets[i], neigh, kind); local_notify_neighbour_1(&local_sockets[i], neigh, kind);
@ -138,10 +114,19 @@
} }
static void static void
--- a/local.h --- a/Makefile
+++ b/local.h +++ b/Makefile
@@ -55,3 +55,4 @@ int local_read(struct local_socket *s); @@ -11,11 +11,11 @@ LDLIBS = -lrt
int local_header(struct local_socket *s);
struct local_socket *local_socket_create(int fd); SRCS = babeld.c net.c kernel.c util.c interface.c source.c neighbour.c \
void local_socket_destroy(int i); route.c xroute.c message.c resend.c configuration.c local.c \
+const char * local_kind(int kind); - hmac.c rfc6234/sha224-256.c BLAKE2/ref/blake2s-ref.c
+ hmac.c ubus.c rfc6234/sha224-256.c BLAKE2/ref/blake2s-ref.c
OBJS = babeld.o net.o kernel.o util.o interface.o source.o neighbour.o \
route.o xroute.o message.o resend.o configuration.o local.o \
- hmac.o rfc6234/sha224-256.o BLAKE2/ref/blake2s-ref.o
+ hmac.o ubus.o rfc6234/sha224-256.o BLAKE2/ref/blake2s-ref.o
babeld: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o babeld $(OBJS) $(LDLIBS)

View file

@ -2,10 +2,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <sys/select.h> #include <sys/select.h>
#include <libubus.h>
#include <libubox/blob.h> #include <libubox/blob.h>
#include <libubox/blobmsg.h> #include <libubox/blobmsg.h>
#include <libubox/list.h> #include <libubox/list.h>
#include <libubus.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <net/if.h> #include <net/if.h>
@ -23,7 +23,6 @@
#include "net.h" #include "net.h"
#include "resend.h" #include "resend.h"
#include "route.h" #include "route.h"
#include "rule.h"
#include "source.h" #include "source.h"
#include "util.h" #include "util.h"
#include "version.h" #include "version.h"
@ -55,6 +54,95 @@ struct neighbour_list_entry {
struct neighbour *neighbour; struct neighbour *neighbour;
}; };
// Definition of interface function enums (to be used with ubox's blobmsg
// helpers).
enum { INTERFACE_IFNAME, __INTERFACE_MAX };
// Definition of interface parsing (to be used with ubox's blobmsg helpers).
static const struct blobmsg_policy interface_policy[__INTERFACE_MAX] = {
[INTERFACE_IFNAME] = {"ifname", BLOBMSG_TYPE_STRING},
};
// Definition of filter function enums (to be used with ubox's blobmsg
// helpers).
enum { FILTER_IFNAME, FILTER_TYPE, FILTER_METRIC, __FILTER_MAX };
// Definition of filter parsing (to be used with ubox's blobmsg helpers).
static const struct blobmsg_policy filter_policy[__FILTER_MAX] = {
[FILTER_IFNAME] = {"ifname", BLOBMSG_TYPE_STRING},
[FILTER_TYPE] = {"type", BLOBMSG_TYPE_INT32},
[FILTER_METRIC] = {"metric", BLOBMSG_TYPE_INT32},
};
// Adds a filter (ubus equivalent to "filter"-function).
static int babeld_ubus_add_filter(struct ubus_context *ctx_local,
struct ubus_object *obj,
struct ubus_request_data *req,
const char *method, struct blob_attr *msg) {
struct blob_attr *tb[__FILTER_MAX];
struct blob_buf b = {0};
struct filter *filter = NULL;
char *ifname;
int metric, type;
blobmsg_parse(filter_policy, __FILTER_MAX, tb, blob_data(msg), blob_len(msg));
if (!tb[FILTER_IFNAME])
return UBUS_STATUS_INVALID_ARGUMENT;
if (!tb[FILTER_TYPE])
return UBUS_STATUS_INVALID_ARGUMENT;
type = blobmsg_get_u32(tb[FILTER_TYPE]);
if (tb[FILTER_METRIC])
metric = blobmsg_get_u32(tb[FILTER_METRIC]);
filter = calloc(1, sizeof(struct filter));
if (filter == NULL)
return UBUS_STATUS_UNKNOWN_ERROR;
filter->af = AF_INET6;
filter->proto = 0;
filter->plen_le = 128;
filter->src_plen_le = 128;
filter->action.add_metric = metric;
ifname = blobmsg_get_string(tb[FILTER_IFNAME]);
filter->ifname = strdup(ifname);
filter->ifindex = if_nametoindex(filter->ifname);
add_filter(filter, type);
return UBUS_STATUS_OK;
}
// Adds an inteface (ubus equivalent to "interface"-function).
static int babeld_ubus_add_interface(struct ubus_context *ctx_local,
struct ubus_object *obj,
struct ubus_request_data *req,
const char *method,
struct blob_attr *msg) {
struct blob_attr *tb[__INTERFACE_MAX];
struct blob_buf b = {0};
struct interface *ifp = NULL;
char *ifname;
blobmsg_parse(interface_policy, __INTERFACE_MAX, tb, blob_data(msg),
blob_len(msg));
if (!tb[INTERFACE_IFNAME])
return UBUS_STATUS_INVALID_ARGUMENT;
ifname = blobmsg_get_string(tb[INTERFACE_IFNAME]);
ifp = add_interface(ifname, NULL);
if (ifp == NULL)
return UBUS_STATUS_UNKNOWN_ERROR;
return UBUS_STATUS_OK;
}
// Sends a babel info message on ubus socket. // Sends a babel info message on ubus socket.
static int babeld_ubus_babeld_info(struct ubus_context *ctx_local, static int babeld_ubus_babeld_info(struct ubus_context *ctx_local,
struct ubus_object *obj, struct ubus_object *obj,
@ -75,6 +163,8 @@ static int babeld_ubus_babeld_info(struct ubus_context *ctx_local,
if (ret) if (ret)
fprintf(stderr, "Failed to send reply: %s\n", ubus_strerror(ret)); fprintf(stderr, "Failed to send reply: %s\n", ubus_strerror(ret));
blob_buf_free(&b);
return ret; return ret;
} }
@ -104,6 +194,8 @@ static int babeld_ubus_get_xroutes(struct ubus_context *ctx_local,
LIST_HEAD(xroute_ipv4_list); LIST_HEAD(xroute_ipv4_list);
LIST_HEAD(xroute_ipv6_list); LIST_HEAD(xroute_ipv6_list);
blob_buf_init(&b, 0);
xroutes = xroute_stream(); xroutes = xroute_stream();
if (xroutes) { if (xroutes) {
while (1) { while (1) {
@ -124,7 +216,6 @@ static int babeld_ubus_get_xroutes(struct ubus_context *ctx_local,
xroute_stream_done(xroutes); xroute_stream_done(xroutes);
} }
blob_buf_init(&b, 0);
ipv4 = blobmsg_open_table(&b, "IPv4"); ipv4 = blobmsg_open_table(&b, "IPv4");
list_for_each_entry_safe(cur, tmp, &xroute_ipv4_list, list) { list_for_each_entry_safe(cur, tmp, &xroute_ipv4_list, list) {
babeld_add_xroute_buf(cur->xroute, &b); babeld_add_xroute_buf(cur->xroute, &b);
@ -145,6 +236,8 @@ static int babeld_ubus_get_xroutes(struct ubus_context *ctx_local,
if (ret) if (ret)
fprintf(stderr, "Failed to send reply: %s\n", ubus_strerror(ret)); fprintf(stderr, "Failed to send reply: %s\n", ubus_strerror(ret));
blob_buf_free(&b);
return ret; return ret;
} }
@ -209,7 +302,7 @@ static int babeld_ubus_get_routes(struct ubus_context *ctx_local,
blob_buf_init(&b, 0); blob_buf_init(&b, 0);
routes = route_stream(ROUTE_ALL); routes = route_stream(0);
if (routes) { if (routes) {
while (1) { while (1) {
struct babel_route *route = route_stream_next(routes); struct babel_route *route = route_stream_next(routes);
@ -227,7 +320,6 @@ static int babeld_ubus_get_routes(struct ubus_context *ctx_local,
route_stream_done(routes); route_stream_done(routes);
} }
blob_buf_init(&b, 0);
ipv4 = blobmsg_open_table(&b, "IPv4"); ipv4 = blobmsg_open_table(&b, "IPv4");
list_for_each_entry_safe(cur, tmp, &route_ipv4_list, list) { list_for_each_entry_safe(cur, tmp, &route_ipv4_list, list) {
babeld_add_route_buf(cur->route, &b); babeld_add_route_buf(cur->route, &b);
@ -248,6 +340,8 @@ static int babeld_ubus_get_routes(struct ubus_context *ctx_local,
if (ret) if (ret)
fprintf(stderr, "Failed to send reply: %s\n", ubus_strerror(ret)); fprintf(stderr, "Failed to send reply: %s\n", ubus_strerror(ret));
blob_buf_free(&b);
return ret; return ret;
} }
@ -296,8 +390,6 @@ static int babeld_ubus_get_neighbours(struct ubus_context *ctx_local,
} }
} }
blob_buf_init(&b, 0);
ipv4 = blobmsg_open_table(&b, "IPv4"); ipv4 = blobmsg_open_table(&b, "IPv4");
list_for_each_entry_safe(cur, tmp, &neighbour_ipv4_list, list) { list_for_each_entry_safe(cur, tmp, &neighbour_ipv4_list, list) {
babeld_add_neighbour_buf(cur->neighbour, &b); babeld_add_neighbour_buf(cur->neighbour, &b);
@ -318,11 +410,15 @@ static int babeld_ubus_get_neighbours(struct ubus_context *ctx_local,
if (ret) if (ret)
fprintf(stderr, "Failed to send reply: %s\n", ubus_strerror(ret)); fprintf(stderr, "Failed to send reply: %s\n", ubus_strerror(ret));
blob_buf_free(&b);
return ret; return ret;
} }
// List of functions we expose via the ubus bus. // List of functions we expose via the ubus bus.
static const struct ubus_method babeld_methods[] = { static const struct ubus_method babeld_methods[] = {
UBUS_METHOD("add_interface", babeld_ubus_add_interface, interface_policy),
UBUS_METHOD("add_filter", babeld_ubus_add_filter, filter_policy),
UBUS_METHOD_NOARG("get_info", babeld_ubus_babeld_info), UBUS_METHOD_NOARG("get_info", babeld_ubus_babeld_info),
UBUS_METHOD_NOARG("get_xroutes", babeld_ubus_get_xroutes), UBUS_METHOD_NOARG("get_xroutes", babeld_ubus_get_xroutes),
UBUS_METHOD_NOARG("get_routes", babeld_ubus_get_routes), UBUS_METHOD_NOARG("get_routes", babeld_ubus_get_routes),
@ -384,6 +480,7 @@ void ubus_notify_route(struct babel_route *route, int kind) {
babeld_add_route_buf(route, &b); babeld_add_route_buf(route, &b);
snprintf(method, sizeof(method), "route.%s", local_kind(kind)); snprintf(method, sizeof(method), "route.%s", local_kind(kind));
ubus_notify(shared_ctx, &babeld_object, method, b.head, -1); ubus_notify(shared_ctx, &babeld_object, method, b.head, -1);
blob_buf_free(&b);
} }
void ubus_notify_xroute(struct xroute *xroute, int kind) { void ubus_notify_xroute(struct xroute *xroute, int kind) {
@ -404,6 +501,7 @@ void ubus_notify_xroute(struct xroute *xroute, int kind) {
babeld_add_xroute_buf(xroute, &b); babeld_add_xroute_buf(xroute, &b);
snprintf(method, sizeof(method), "xroute.%s", local_kind(kind)); snprintf(method, sizeof(method), "xroute.%s", local_kind(kind));
ubus_notify(shared_ctx, &babeld_object, method, b.head, -1); ubus_notify(shared_ctx, &babeld_object, method, b.head, -1);
blob_buf_free(&b);
} }
void ubus_notify_neighbour(struct neighbour *neigh, int kind) { void ubus_notify_neighbour(struct neighbour *neigh, int kind) {
@ -423,6 +521,7 @@ void ubus_notify_neighbour(struct neighbour *neigh, int kind) {
babeld_add_neighbour_buf(neigh, &b); babeld_add_neighbour_buf(neigh, &b);
snprintf(method, sizeof(method), "neigh.%s", local_kind(kind)); snprintf(method, sizeof(method), "neigh.%s", local_kind(kind));
ubus_notify(shared_ctx, &babeld_object, method, b.head, -1); ubus_notify(shared_ctx, &babeld_object, method, b.head, -1);
blob_buf_free(&b);
} }
void babeld_ubus_receive(fd_set *readfds) { void babeld_ubus_receive(fd_set *readfds) {

View file

@ -2,6 +2,13 @@
IPC integration of babeld with OpenWrt. IPC integration of babeld with OpenWrt.
The ubus interface offers following functions: The ubus interface offers following functions:
- add_filter '{"ifname":"eth0", "type":0, "metric":5000}'
type:
0: FILTER_TYPE_INPUT
1: FILTER_TYPE_OUTPUT
2: FILTER_TYPE_REDISTRIBUTE
3: FILTER_TYPE_INSTALL
- add_interface '{"ifname":"eth0"}'
- get_info - get_info
- get_neighbours - get_neighbours
- get_xroutes - get_xroutes

View file

@ -3,12 +3,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=batctl PKG_NAME:=batctl
PKG_VERSION:=2021.0 PKG_VERSION:=2021.1
PKG_RELEASE:=1 PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_HASH:=9cec8bf1952f885192749a9dc0318a54633b717aaf05c438d504efd83f5201e4 PKG_HASH:=44b28cebb46b8ba1bc170bedeef67f69d89503806c429ff8cb113cc01966e176
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de> PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
@ -95,27 +95,37 @@ config-n := \
backbonetable \ backbonetable \
bisect_iv \ bisect_iv \
bonding \ bonding \
bla_backbone_json \
bla_claim_json \
bridge_loop_avoidance \ bridge_loop_avoidance \
claimtable \ claimtable \
dat_cache \ dat_cache \
dat_cache_json \
distributed_arp_table \ distributed_arp_table \
elp_interval \ elp_interval \
event \ event \
fragmentation \ fragmentation \
gateways \ gateways \
gateways_json \
gw_mode \ gw_mode \
hardif_json \
hardifs_json \
hop_penalty \ hop_penalty \
interface \ interface \
isolation_mark \ isolation_mark \
loglevel \ loglevel \
mcast_flags \ mcast_flags \
mcast_flags_json \
mesh_json \
multicast_fanout \ multicast_fanout \
multicast_forceflood \ multicast_forceflood \
multicast_mode \ multicast_mode \
neighbors \ neighbors \
neighbors_json \
network_coding \ network_coding \
orig_interval \ orig_interval \
originators \ originators \
originators_json \
ping \ ping \
routing_algo \ routing_algo \
statistics \ statistics \
@ -126,6 +136,9 @@ config-n := \
transglobal \ transglobal \
translate \ translate \
translocal \ translocal \
transtable_global_json \
transtable_local_json \
vlan_json \
config-settings := \ config-settings := \
aggregation \ aggregation \
@ -160,6 +173,21 @@ config-tables := \
transglobal \ transglobal \
translocal \ translocal \
config-json := \
bla_backbone_json \
bla_claim_json \
dat_cache_json \
gateways_json \
hardif_json \
hardifs_json \
mcast_flags_json \
mesh_json \
neighbors_json \
originators_json \
transtable_global_json \
transtable_local_json \
vlan_json \
config-tools := \ config-tools := \
event \ event \
ping \ ping \
@ -183,6 +211,7 @@ ifeq ($(BUILD_VARIANT),default)
config-y := \ config-y := \
$(config-settings) \ $(config-settings) \
$(config-tables) \ $(config-tables) \
$(config-json) \
$(config-tools) \ $(config-tools) \
endif endif
@ -192,6 +221,7 @@ ifeq ($(BUILD_VARIANT),full)
config-y := \ config-y := \
$(config-settings) \ $(config-settings) \
$(config-tables) \ $(config-tables) \
$(config-json) \
$(config-tools) \ $(config-tools) \
$(config-extratools) \ $(config-extratools) \

View file

@ -1,25 +0,0 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Thu, 28 Jan 2021 20:44:22 +0100
Subject: batctl: Fix build of routing_algo against musl
glibc is including the headers for the rtnetlink functionality. But musl
avoids this indirect include. The headers must therefore be included
explicitely.
Fixes: e0ccb9b575d9 ("batctl: Switch active routing algo list to netlink")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batctl.git/commit/b0044a6b2f8a762387d9b7408b1fe528f21c4ad7
diff --git a/routing_algo.c b/routing_algo.c
index 27458ffdd9b91decbecbe6ec5da8ffd14c863a35..b5e3ebb8c5a4743cd2c42634d79f8a4c6a8210db 100644
--- a/routing_algo.c
+++ b/routing_algo.c
@@ -9,6 +9,8 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
+#include <linux/if_link.h>
+#include <linux/rtnetlink.h>
#include <netinet/if_ether.h>
#include <netlink/netlink.h>
#include <netlink/genl/genl.h>

View file

@ -0,0 +1,29 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 22 Apr 2022 11:14:08 +0200
Subject: batctl: ping: Skip sleep after last packet
The -i option for ping is documented as interval between ping requests. But
the sleep was also applied after all the requested pings already sent out.
As result, the user had to wait additional time until the statistics for
the (limited) ping test was printed.
Just skip the last sleep in case there will be no next ping packet to avoid
this problem.
Reported-by: Roman Le bg <roman@romanlebg.fr>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batctl.git/commit/47d063213d5843d1ca33c557bd4a874db3e90e9e)
--- a/ping.c
+++ b/ping.c
@@ -282,6 +282,10 @@ read_packet:
}
sleep:
+ /* skip last sleep in case no more packets will be sent out */
+ if (loop_count == 0)
+ continue;
+
if (loop_interval > 0)
sleep(loop_interval);
else if ((tv.tv_sec != 0) || (tv.tv_usec != 0))

View file

@ -3,12 +3,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv PKG_NAME:=batman-adv
PKG_VERSION:=2021.0 PKG_VERSION:=2021.1
PKG_RELEASE:=1 PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_HASH:=5a989ba580897268373bd516b87b588061f344af773a0f6b038a3d8d2af028a1 PKG_HASH:=bf77843d8dead75342d673ce7021e4ad037447ce18c64056ae1e3202039934d0
PKG_EXTMOD_SUBDIRS:=net/batman-adv PKG_EXTMOD_SUBDIRS:=net/batman-adv
PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de> PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
@ -17,6 +17,15 @@ PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
PKG_CONFIG_DEPENDS += \
CONFIG_BATMAN_ADV_BATMAN_V \
CONFIG_BATMAN_ADV_BLA \
CONFIG_BATMAN_ADV_DAT \
CONFIG_BATMAN_ADV_NC \
CONFIG_BATMAN_ADV_MCAST \
CONFIG_BATMAN_ADV_DEBUG \
CONFIG_BATMAN_ADV_TRACING
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -61,6 +70,7 @@ PKG_EXTRA_CFLAGS:= \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
NOSTDINC_FLAGS = \ NOSTDINC_FLAGS = \
$(KERNEL_NOSTDINC_FLAGS) \
-I$(PKG_BUILD_DIR)/net/batman-adv \ -I$(PKG_BUILD_DIR)/net/batman-adv \
-I$(STAGING_DIR)/usr/include/mac80211-backport \ -I$(STAGING_DIR)/usr/include/mac80211-backport \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \

View file

@ -12,11 +12,9 @@ or newer - otherwise it will not work as expected.
This reverts commit 725b4ef5be840cfcd0ca33b9393c14dee40c10f7. This reverts commit 725b4ef5be840cfcd0ca33b9393c14dee40c10f7.
diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h
index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533bee89a67 100644
--- a/compat-include/net/genetlink.h --- a/compat-include/net/genetlink.h
+++ b/compat-include/net/genetlink.h +++ b/compat-include/net/genetlink.h
@@ -31,17 +31,15 @@ void batadv_genl_dump_check_consistent(struct netlink_callback *cb, @@ -31,17 +31,15 @@ void batadv_genl_dump_check_consistent(s
#endif /* LINUX_VERSION_IS_LESS(4, 15, 0) */ #endif /* LINUX_VERSION_IS_LESS(4, 15, 0) */
@ -48,7 +46,7 @@ index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533
unsigned int n_mcgrps; unsigned int n_mcgrps;
struct module *module; struct module *module;
@@ -96,32 +94,24 @@ static inline int batadv_genl_register_family(struct batadv_genl_family *family) @@ -96,32 +94,24 @@ static inline int batadv_genl_register_f
family->family.pre_doit = family->pre_doit; family->family.pre_doit = family->pre_doit;
family->family.post_doit = family->post_doit; family->family.post_doit = family->post_doit;
family->family.mcgrps = family->mcgrps; family->family.mcgrps = family->mcgrps;
@ -89,7 +87,7 @@ index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533
family->family.ops = ops; family->family.ops = ops;
family->copy_ops = ops; family->copy_ops = ops;
@@ -136,7 +126,7 @@ typedef struct genl_ops batadv_genl_ops_old; @@ -136,7 +126,7 @@ typedef struct genl_ops batadv_genl_ops_
#define batadv_post_doit(__x, __y, __z) \ #define batadv_post_doit(__x, __y, __z) \
batadv_post_doit(const batadv_genl_ops_old *ops, __y, __z) batadv_post_doit(const batadv_genl_ops_old *ops, __y, __z)
@ -98,7 +96,7 @@ index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533
#define genl_family batadv_genl_family #define genl_family batadv_genl_family
#define genl_register_family(family) \ #define genl_register_family(family) \
@@ -160,6 +150,6 @@ batadv_genl_unregister_family(struct batadv_genl_family *family) @@ -160,6 +150,6 @@ batadv_genl_unregister_family(struct bat
genlmsg_multicast_netns(&(_family)->family, _net, _skb, _portid, \ genlmsg_multicast_netns(&(_family)->family, _net, _skb, _portid, \
_group, _flags) _group, _flags)
@ -106,11 +104,9 @@ index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533
+#endif /* LINUX_VERSION_IS_LESS(5, 2, 0) */ +#endif /* LINUX_VERSION_IS_LESS(5, 2, 0) */
#endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */ #endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 97bcf149633d850ff4fcece6d7dc0d799adb1444..a8f15c04826af1144db655887b754758fc5ab47a 100644
--- a/net/batman-adv/netlink.c --- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c
@@ -1351,7 +1351,7 @@ static void batadv_post_doit(const struct genl_ops *ops, struct sk_buff *skb, @@ -1351,7 +1351,7 @@ static void batadv_post_doit(const struc
} }
} }
@ -119,7 +115,7 @@ index 97bcf149633d850ff4fcece6d7dc0d799adb1444..a8f15c04826af1144db655887b754758
{ {
.cmd = BATADV_CMD_GET_MESH, .cmd = BATADV_CMD_GET_MESH,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
@@ -1485,8 +1485,8 @@ struct genl_family batadv_netlink_family __ro_after_init = { @@ -1485,8 +1485,8 @@ struct genl_family batadv_netlink_family
.pre_doit = batadv_pre_doit, .pre_doit = batadv_pre_doit,
.post_doit = batadv_post_doit, .post_doit = batadv_post_doit,
.module = THIS_MODULE, .module = THIS_MODULE,

View file

@ -9,14 +9,11 @@ This reverts commit 1810de05310d5c5e9140f870ac21052f38bc06b8.
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
diff --git a/compat-include/linux/minmax.h b/compat-include/linux/minmax.h
deleted file mode 100644
index 4b19479bc5ea12c5005485f623decfad90a85cff..0000000000000000000000000000000000000000
--- a/compat-include/linux/minmax.h --- a/compat-include/linux/minmax.h
+++ /dev/null +++ /dev/null
@@ -1,20 +0,0 @@ @@ -1,20 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */ -/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors: -/* Copyright (C) B.A.T.M.A.N. contributors:
- * - *
- * Marek Lindner, Simon Wunderlich - * Marek Lindner, Simon Wunderlich
- * - *
@ -35,8 +32,6 @@ index 4b19479bc5ea12c5005485f623decfad90a85cff..00000000000000000000000000000000
-#endif -#endif
- -
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_MINMAX_H_ */ -#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_MINMAX_H_ */
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index e4455babe4c28f8c1527a17e825675183c37ea1d..22183e954647089ca72a941e744375d72e1f94b0 100644
--- a/net/batman-adv/bat_v.c --- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c
@@ -15,7 +15,6 @@ @@ -15,7 +15,6 @@
@ -47,8 +42,6 @@ index e4455babe4c28f8c1527a17e825675183c37ea1d..22183e954647089ca72a941e744375d7
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/netlink.h> #include <linux/netlink.h>
#include <linux/rculist.h> #include <linux/rculist.h>
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 0512ea6cd818c22768e601f446ff806cf863163b..79a7dfc32e76c511c5b5d8716cbebf64f6228d9d 100644
--- a/net/batman-adv/bat_v_elp.c --- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c
@@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
@ -59,8 +52,6 @@ index 0512ea6cd818c22768e601f446ff806cf863163b..79a7dfc32e76c511c5b5d8716cbebf64
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/nl80211.h> #include <linux/nl80211.h>
#include <linux/prandom.h> #include <linux/prandom.h>
diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c
index 798d659855d0bcc9d7638901fedeb77d830f1980..8c1148fc73d776c076bdb35896f5536d7378578d 100644
--- a/net/batman-adv/bat_v_ogm.c --- a/net/batman-adv/bat_v_ogm.c
+++ b/net/batman-adv/bat_v_ogm.c +++ b/net/batman-adv/bat_v_ogm.c
@@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
@ -71,8 +62,6 @@ index 798d659855d0bcc9d7638901fedeb77d830f1980..8c1148fc73d776c076bdb35896f5536d
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/prandom.h> #include <linux/prandom.h>
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index e522f1fcfd9af04ee2d92b1b11ace6960d6f9c9f..ea40e54867573320d44e68524589454db553fb81 100644
--- a/net/batman-adv/fragmentation.c --- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c
@@ -14,8 +14,8 @@ @@ -14,8 +14,8 @@
@ -85,8 +74,6 @@ index e522f1fcfd9af04ee2d92b1b11ace6960d6f9c9f..ea40e54867573320d44e68524589454d
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/slab.h> #include <linux/slab.h>
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 0f186ddc15e30a9c9f5e4de44b96b2c7b27d8b86..b57e95c959cf064a74a01d25a24bdc495caa6324 100644
--- a/net/batman-adv/hard-interface.c --- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c
@@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
@ -97,8 +84,6 @@ index 0f186ddc15e30a9c9f5e4de44b96b2c7b27d8b86..b57e95c959cf064a74a01d25a24bdc49
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/printk.h> #include <linux/printk.h>
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index ed9d87ce3407614e5e37922fe3039324adb027cc..edc0d53e9ba0a79ad0c37986e15ec362fb009f4f 100644
--- a/net/batman-adv/main.c --- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c +++ b/net/batman-adv/main.c
@@ -23,7 +23,6 @@ @@ -23,7 +23,6 @@
@ -109,8 +94,6 @@ index ed9d87ce3407614e5e37922fe3039324adb027cc..edc0d53e9ba0a79ad0c37986e15ec362
#include <linux/module.h> #include <linux/module.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/printk.h> #include <linux/printk.h>
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index a8f15c04826af1144db655887b754758fc5ab47a..dc193618a761c0b451e860ca83921007d286e09b 100644
--- a/net/batman-adv/netlink.c --- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c
@@ -23,7 +23,6 @@ @@ -23,7 +23,6 @@
@ -121,8 +104,6 @@ index a8f15c04826af1144db655887b754758fc5ab47a..dc193618a761c0b451e860ca83921007
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/netlink.h> #include <linux/netlink.h>
#include <linux/printk.h> #include <linux/printk.h>
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index d4e10005df6cd2936a3132e1ad7bd8bf3c1d99b6..db7e3774825b5f5871b23c0e4fa5ce7afb2accd6 100644
--- a/net/batman-adv/tp_meter.c --- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c
@@ -23,7 +23,6 @@ @@ -23,7 +23,6 @@

View file

@ -0,0 +1,34 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 14 May 2021 19:34:35 +0200
Subject: batman-adv: Fix build of multicast code against Linux < 5.13
Fixes: 007b4c4b031f ("batman-adv: convert ifmcaddr6 to RCU")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -454,9 +454,14 @@ batadv_mcast_mla_softif_get_ipv6(struct
return 0;
}
+#if LINUX_VERSION_IS_LESS(5, 13, 0)
+ read_lock_bh(&in6_dev->lock);
+ for (pmc6 = in6_dev->mc_list; pmc6; pmc6 = pmc6->next) {
+#else
for (pmc6 = rcu_dereference(in6_dev->mc_list);
pmc6;
pmc6 = rcu_dereference(pmc6->next)) {
+#endif
if (IPV6_ADDR_MC_SCOPE(&pmc6->mca_addr) <
IPV6_ADDR_SCOPE_LINKLOCAL)
continue;
@@ -485,6 +490,9 @@ batadv_mcast_mla_softif_get_ipv6(struct
hlist_add_head(&new->list, mcast_list);
ret++;
}
+#if LINUX_VERSION_IS_LESS(5, 13, 0)
+ read_unlock_bh(&in6_dev->lock);
+#endif
rcu_read_unlock();
return ret;

View file

@ -0,0 +1,111 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Mon, 10 May 2021 15:05:42 +0200
Subject: batman-adv: Always send iface index+name in genlmsg
The batman-adv netlink messages often contain the interface index and
interface name in the same message. This makes it easy for the receiver to
operate on the incoming data when it either needs to print something or
needs to operate on the interface index.
But one of the attributes was missing for:
* neighbor table dumps
* originator table dumps
* gateway list dumps
* query of hardif information
* query of vid information
The userspace therefore had to implement special workarounds using
SIOCGIFNAME or SIOCGIFINDEX depending on what was actually provided.
Providing both information simplifies the userspace code massively without
adding a lot of extra overhead in the kernel portion.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/77c7d62618259f22f36427eaa62668e6e1c43090
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -1849,6 +1849,8 @@ batadv_iv_ogm_orig_dump_subentry(struct
orig_node->orig) ||
nla_put(msg, BATADV_ATTR_NEIGH_ADDRESS, ETH_ALEN,
neigh_node->addr) ||
+ nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
+ neigh_node->if_incoming->net_dev->name) ||
nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
neigh_node->if_incoming->net_dev->ifindex) ||
nla_put_u8(msg, BATADV_ATTR_TQ, tq_avg) ||
@@ -2078,6 +2080,8 @@ batadv_iv_ogm_neigh_dump_neigh(struct sk
if (nla_put(msg, BATADV_ATTR_NEIGH_ADDRESS, ETH_ALEN,
hardif_neigh->addr) ||
+ nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
+ hardif_neigh->if_incoming->net_dev->name) ||
nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
hardif_neigh->if_incoming->net_dev->ifindex) ||
nla_put_u32(msg, BATADV_ATTR_LAST_SEEN_MSECS,
@@ -2459,6 +2463,8 @@ static int batadv_iv_gw_dump_entry(struc
router->addr) ||
nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
router->if_incoming->net_dev->name) ||
+ nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
+ router->if_incoming->net_dev->ifindex) ||
nla_put_u32(msg, BATADV_ATTR_BANDWIDTH_DOWN,
gw_node->bandwidth_down) ||
nla_put_u32(msg, BATADV_ATTR_BANDWIDTH_UP,
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -145,6 +145,8 @@ batadv_v_neigh_dump_neigh(struct sk_buff
if (nla_put(msg, BATADV_ATTR_NEIGH_ADDRESS, ETH_ALEN,
hardif_neigh->addr) ||
+ nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
+ hardif_neigh->if_incoming->net_dev->name) ||
nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
hardif_neigh->if_incoming->net_dev->ifindex) ||
nla_put_u32(msg, BATADV_ATTR_LAST_SEEN_MSECS,
@@ -297,6 +299,8 @@ batadv_v_orig_dump_subentry(struct sk_bu
if (nla_put(msg, BATADV_ATTR_ORIG_ADDRESS, ETH_ALEN, orig_node->orig) ||
nla_put(msg, BATADV_ATTR_NEIGH_ADDRESS, ETH_ALEN,
neigh_node->addr) ||
+ nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
+ neigh_node->if_incoming->net_dev->name) ||
nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
neigh_node->if_incoming->net_dev->ifindex) ||
nla_put_u32(msg, BATADV_ATTR_THROUGHPUT, throughput) ||
@@ -737,6 +741,12 @@ static int batadv_v_gw_dump_entry(struct
genlmsg_cancel(msg, hdr);
goto out;
}
+
+ if (nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
+ router->if_incoming->net_dev->ifindex)) {
+ genlmsg_cancel(msg, hdr);
+ goto out;
+ }
if (nla_put_u32(msg, BATADV_ATTR_BANDWIDTH_DOWN,
gw_node->bandwidth_down)) {
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -813,6 +813,10 @@ static int batadv_netlink_hardif_fill(st
bat_priv->soft_iface->ifindex))
goto nla_put_failure;
+ if (nla_put_string(msg, BATADV_ATTR_MESH_IFNAME,
+ bat_priv->soft_iface->name))
+ goto nla_put_failure;
+
if (nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
net_dev->ifindex) ||
nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
@@ -1044,6 +1048,10 @@ static int batadv_netlink_vlan_fill(stru
bat_priv->soft_iface->ifindex))
goto nla_put_failure;
+ if (nla_put_string(msg, BATADV_ATTR_MESH_IFNAME,
+ bat_priv->soft_iface->name))
+ goto nla_put_failure;
+
if (nla_put_u32(msg, BATADV_ATTR_VLANID, vlan->vid & VLAN_VID_MASK))
goto nla_put_failure;

View file

@ -0,0 +1,31 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Tue, 18 May 2021 21:00:27 +0200
Subject: batman-adv: Avoid WARN_ON timing related checks
The soft/batadv interface for a queued OGM can be changed during the time
the OGM was queued for transmission and when the OGM is actually
transmitted by the worker.
But WARN_ON must be used to denote kernel bugs and not to print simple
warnings. A warning can simply be printed using pr_warn.
Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Reported-by: syzbot+c0b807de416427ff3dd1@syzkaller.appspotmail.com
Fixes: 29b9256e6631 ("batman-adv: consider outgoing interface in OGM sending")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/5061f9c502d7101912089d8f4a7866e0a926a49a
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -409,8 +409,10 @@ static void batadv_iv_ogm_emit(struct ba
if (WARN_ON(!forw_packet->if_outgoing))
return;
- if (WARN_ON(forw_packet->if_outgoing->soft_iface != soft_iface))
+ if (forw_packet->if_outgoing->soft_iface != soft_iface) {
+ pr_warn("%s: soft interface switch for queued OGM\n", __func__);
return;
+ }
if (forw_packet->if_incoming->if_status != BATADV_IF_ACTIVE)
return;

View file

@ -0,0 +1,162 @@
From: Pavel Skripkin <paskripkin@gmail.com>
Date: Sun, 24 Oct 2021 16:13:56 +0300
Subject: batman-adv: fix error handling
Syzbot reported ODEBUG warning in batadv_nc_mesh_free(). The problem was
in wrong error handling in batadv_mesh_init().
Before this patch batadv_mesh_init() was calling batadv_mesh_free() in case
of any batadv_*_init() calls failure. This approach may work well, when
there is some kind of indicator, which can tell which parts of batadv are
initialized; but there isn't any.
All written above lead to cleaning up uninitialized fields. Even if we hide
ODEBUG warning by initializing bat_priv->nc.work, syzbot was able to hit
GPF in batadv_nc_purge_paths(), because hash pointer in still NULL. [1]
To fix these bugs we can unwind batadv_*_init() calls one by one.
It is good approach for 2 reasons: 1) It fixes bugs on error handling
path 2) It improves the performance, since we won't call unneeded
batadv_*_free() functions.
So, this patch makes all batadv_*_init() clean up all allocated memory
before returning with an error to no call correspoing batadv_*_free()
and open-codes batadv_mesh_free() with proper order to avoid touching
uninitialized fields.
Link: https://lore.kernel.org/netdev/000000000000c87fbd05cef6bcb0@google.com/ [1]
Reported-and-tested-by: syzbot+28b0702ada0bf7381f58@syzkaller.appspotmail.com
Fixes: 21e838760727 ("[batman-adv] fix various race conditions during startup & shutdown")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/0631e0825c8129cd3896926da62a09ac00bf13a0
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1556,10 +1556,14 @@ int batadv_bla_init(struct batadv_priv *
return 0;
bat_priv->bla.claim_hash = batadv_hash_new(128);
- bat_priv->bla.backbone_hash = batadv_hash_new(32);
+ if (!bat_priv->bla.claim_hash)
+ return -ENOMEM;
- if (!bat_priv->bla.claim_hash || !bat_priv->bla.backbone_hash)
+ bat_priv->bla.backbone_hash = batadv_hash_new(32);
+ if (!bat_priv->bla.backbone_hash) {
+ batadv_hash_destroy(bat_priv->bla.claim_hash);
return -ENOMEM;
+ }
batadv_hash_set_lock_class(bat_priv->bla.claim_hash,
&batadv_claim_hash_lock_class_key);
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -189,29 +189,41 @@ int batadv_mesh_init(struct net_device *
bat_priv->gw.generation = 0;
- ret = batadv_v_mesh_init(bat_priv);
- if (ret < 0)
- goto err;
-
ret = batadv_originator_init(bat_priv);
- if (ret < 0)
- goto err;
+ if (ret < 0) {
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
+ goto err_orig;
+ }
ret = batadv_tt_init(bat_priv);
- if (ret < 0)
- goto err;
+ if (ret < 0) {
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
+ goto err_tt;
+ }
+
+ ret = batadv_v_mesh_init(bat_priv);
+ if (ret < 0) {
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
+ goto err_v;
+ }
ret = batadv_bla_init(bat_priv);
- if (ret < 0)
- goto err;
+ if (ret < 0) {
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
+ goto err_bla;
+ }
ret = batadv_dat_init(bat_priv);
- if (ret < 0)
- goto err;
+ if (ret < 0) {
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
+ goto err_dat;
+ }
ret = batadv_nc_mesh_init(bat_priv);
- if (ret < 0)
- goto err;
+ if (ret < 0) {
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
+ goto err_nc;
+ }
batadv_gw_init(bat_priv);
batadv_mcast_init(bat_priv);
@@ -221,8 +233,20 @@ int batadv_mesh_init(struct net_device *
return 0;
-err:
- batadv_mesh_free(soft_iface);
+err_nc:
+ batadv_dat_free(bat_priv);
+err_dat:
+ batadv_bla_free(bat_priv);
+err_bla:
+ batadv_v_mesh_free(bat_priv);
+err_v:
+ batadv_tt_free(bat_priv);
+err_tt:
+ batadv_originator_free(bat_priv);
+err_orig:
+ batadv_purge_outstanding_packets(bat_priv, NULL);
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
+
return ret;
}
--- a/net/batman-adv/network-coding.c
+++ b/net/batman-adv/network-coding.c
@@ -152,8 +152,10 @@ int batadv_nc_mesh_init(struct batadv_pr
&batadv_nc_coding_hash_lock_class_key);
bat_priv->nc.decoding_hash = batadv_hash_new(128);
- if (!bat_priv->nc.decoding_hash)
+ if (!bat_priv->nc.decoding_hash) {
+ batadv_hash_destroy(bat_priv->nc.coding_hash);
goto err;
+ }
batadv_hash_set_lock_class(bat_priv->nc.decoding_hash,
&batadv_nc_decoding_hash_lock_class_key);
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -4193,8 +4193,10 @@ int batadv_tt_init(struct batadv_priv *b
return ret;
ret = batadv_tt_global_init(bat_priv);
- if (ret < 0)
+ if (ret < 0) {
+ batadv_tt_local_table_free(bat_priv);
return ret;
+ }
batadv_tvlv_handler_register(bat_priv, batadv_tt_tvlv_ogm_handler_v1,
batadv_tt_tvlv_unicast_handler_v1,

View file

@ -0,0 +1,182 @@
From: Linus Lüssing <linus.luessing@c0d3.blue>
Date: Mon, 1 Nov 2021 21:46:17 +0100
Subject: batman-adv: allow netlink usage in unprivileged containers
Currently, creating a batman-adv interface in an unprivileged LXD
container and attaching secondary interfaces to it with "ip" or "batctl"
works fine. However all batctl debug and configuration commands
fail:
root@container:~# batctl originators
Error received: Operation not permitted
root@container:~# batctl orig_interval
1000
root@container:~# batctl orig_interval 2000
root@container:~# batctl orig_interval
1000
To fix this change the generic netlink permissions from GENL_ADMIN_PERM
to GENL_UNS_ADMIN_PERM. This way a batman-adv interface is fully
maintainable as root from within a user namespace, from an unprivileged
container.
All except one batman-adv netlink setting are per interface and do not
leak information or change settings from the host system and are
therefore save to retrieve or modify as root from within an unprivileged
container.
"batctl routing_algo" / BATADV_CMD_GET_ROUTING_ALGOS is the only
exception: It provides the batman-adv kernel module wide default routing
algorithm. However it is read-only from netlink and an unprivileged
container is still not allowed to modify
/sys/module/batman_adv/parameters/routing_algo. Instead it is advised to
use the newly introduced "batctl if create routing_algo RA_NAME" /
IFLA_BATADV_ALGO_NAME to set the routing algorithm on interface
creation, which already works fine in an unprivileged container.
Cc: Tycho Andersen <tycho@tycho.pizza>
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/055fa41b73ca8dae1c1ed41777e32a8f02e80c82
--- /dev/null
+++ b/compat-include/uapi/linux/genetlink.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (C) B.A.T.M.A.N. contributors:
+ *
+ * Marek Lindner, Simon Wunderlich
+ *
+ * This file contains macros for maintaining compatibility with older versions
+ * of the Linux kernel.
+ */
+
+#ifndef _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_GENETLINK_H_
+#define _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_GENETLINK_H_
+
+#include <linux/version.h>
+#include_next <uapi/linux/genetlink.h>
+
+#if LINUX_VERSION_IS_LESS(4, 6, 0)
+
+#define GENL_UNS_ADMIN_PERM GENL_ADMIN_PERM
+
+#endif /* LINUX_VERSION_IS_LESS(4, 6, 0) */
+
+#endif /* _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_GENETLINK_H_ */
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -1369,21 +1369,21 @@ static const struct genl_ops batadv_netl
{
.cmd = BATADV_CMD_TP_METER,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.doit = batadv_netlink_tp_meter_start,
.internal_flags = BATADV_FLAG_NEED_MESH,
},
{
.cmd = BATADV_CMD_TP_METER_CANCEL,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.doit = batadv_netlink_tp_meter_cancel,
.internal_flags = BATADV_FLAG_NEED_MESH,
},
{
.cmd = BATADV_CMD_GET_ROUTING_ALGOS,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_algo_dump,
},
{
@@ -1398,68 +1398,68 @@ static const struct genl_ops batadv_netl
{
.cmd = BATADV_CMD_GET_TRANSTABLE_LOCAL,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_tt_local_dump,
},
{
.cmd = BATADV_CMD_GET_TRANSTABLE_GLOBAL,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_tt_global_dump,
},
{
.cmd = BATADV_CMD_GET_ORIGINATORS,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_orig_dump,
},
{
.cmd = BATADV_CMD_GET_NEIGHBORS,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_hardif_neigh_dump,
},
{
.cmd = BATADV_CMD_GET_GATEWAYS,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_gw_dump,
},
{
.cmd = BATADV_CMD_GET_BLA_CLAIM,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_bla_claim_dump,
},
{
.cmd = BATADV_CMD_GET_BLA_BACKBONE,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_bla_backbone_dump,
},
{
.cmd = BATADV_CMD_GET_DAT_CACHE,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_dat_cache_dump,
},
{
.cmd = BATADV_CMD_GET_MCAST_FLAGS,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.dumpit = batadv_mcast_flags_dump,
},
{
.cmd = BATADV_CMD_SET_MESH,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.doit = batadv_netlink_set_mesh,
.internal_flags = BATADV_FLAG_NEED_MESH,
},
{
.cmd = BATADV_CMD_SET_HARDIF,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.doit = batadv_netlink_set_hardif,
.internal_flags = BATADV_FLAG_NEED_MESH |
BATADV_FLAG_NEED_HARDIF,
@@ -1475,7 +1475,7 @@ static const struct genl_ops batadv_netl
{
.cmd = BATADV_CMD_SET_VLAN,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .flags = GENL_ADMIN_PERM,
+ .flags = GENL_UNS_ADMIN_PERM,
.doit = batadv_netlink_set_vlan,
.internal_flags = BATADV_FLAG_NEED_MESH |
BATADV_FLAG_NEED_VLAN,

View file

@ -0,0 +1,165 @@
From: Linus Lüssing <linus.luessing@c0d3.blue>
Date: Sat, 1 Jan 2022 06:27:13 +0100
Subject: batman-adv: mcast: don't send link-local multicast to mcast routers
The addition of routable multicast TX handling introduced a
bug/regression for packets with a link-local multicast destination:
These packets would be sent to all batman-adv nodes with a multicast
router and to all batman-adv nodes with an old version without multicast
router detection.
This even disregards the batman-adv multicast fanout setting, which can
potentially lead to an unwanted, high number of unicast transmissions or
even congestion.
Fixing this by avoiding to send link-local multicast packets to nodes in
the multicast router list.
Fixes: 3a8df00cd969 ("batman-adv: mcast: apply optimizations for routable packets, too")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/ee013870947b9175847aa46a0686ca01dd480af4
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -1380,6 +1380,7 @@ batadv_mcast_forw_rtr_node_get(struct ba
* @bat_priv: the bat priv with all the soft interface information
* @skb: The multicast packet to check
* @orig: an originator to be set to forward the skb to
+ * @is_routable: stores whether the destination is routable
*
* Return: the forwarding mode as enum batadv_forw_mode and in case of
* BATADV_FORW_SINGLE set the orig to the single originator the skb
@@ -1387,17 +1388,16 @@ batadv_mcast_forw_rtr_node_get(struct ba
*/
enum batadv_forw_mode
batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
- struct batadv_orig_node **orig)
+ struct batadv_orig_node **orig, int *is_routable)
{
int ret, tt_count, ip_count, unsnoop_count, total_count;
bool is_unsnoopable = false;
unsigned int mcast_fanout;
struct ethhdr *ethhdr;
- int is_routable = 0;
int rtr_count = 0;
ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable,
- &is_routable);
+ is_routable);
if (ret == -ENOMEM)
return BATADV_FORW_NONE;
else if (ret < 0)
@@ -1410,7 +1410,7 @@ batadv_mcast_forw_mode(struct batadv_pri
ip_count = batadv_mcast_forw_want_all_ip_count(bat_priv, ethhdr);
unsnoop_count = !is_unsnoopable ? 0 :
atomic_read(&bat_priv->mcast.num_want_all_unsnoopables);
- rtr_count = batadv_mcast_forw_rtr_count(bat_priv, is_routable);
+ rtr_count = batadv_mcast_forw_rtr_count(bat_priv, *is_routable);
total_count = tt_count + ip_count + unsnoop_count + rtr_count;
@@ -1730,6 +1730,7 @@ batadv_mcast_forw_want_rtr(struct batadv
* @bat_priv: the bat priv with all the soft interface information
* @skb: the multicast packet to transmit
* @vid: the vlan identifier
+ * @is_routable: stores whether the destination is routable
*
* Sends copies of a frame with multicast destination to any node that signaled
* interest in it, that is either via the translation table or the according
@@ -1742,7 +1743,7 @@ batadv_mcast_forw_want_rtr(struct batadv
* is neither IPv4 nor IPv6. NET_XMIT_SUCCESS otherwise.
*/
int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
- unsigned short vid)
+ unsigned short vid, int is_routable)
{
int ret;
@@ -1758,12 +1759,16 @@ int batadv_mcast_forw_send(struct batadv
return ret;
}
+ if (!is_routable)
+ goto skip_mc_router;
+
ret = batadv_mcast_forw_want_rtr(bat_priv, skb, vid);
if (ret != NET_XMIT_SUCCESS) {
kfree_skb(skb);
return ret;
}
+skip_mc_router:
consume_skb(skb);
return ret;
}
--- a/net/batman-adv/multicast.h
+++ b/net/batman-adv/multicast.h
@@ -43,7 +43,8 @@ enum batadv_forw_mode {
enum batadv_forw_mode
batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
- struct batadv_orig_node **mcast_single_orig);
+ struct batadv_orig_node **mcast_single_orig,
+ int *is_routable);
int batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv,
struct sk_buff *skb,
@@ -51,7 +52,7 @@ int batadv_mcast_forw_send_orig(struct b
struct batadv_orig_node *orig_node);
int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
- unsigned short vid);
+ unsigned short vid, int is_routable);
void batadv_mcast_init(struct batadv_priv *bat_priv);
@@ -68,7 +69,8 @@ void batadv_mcast_purge_orig(struct bata
static inline enum batadv_forw_mode
batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
- struct batadv_orig_node **mcast_single_orig)
+ struct batadv_orig_node **mcast_single_orig,
+ int *is_routable)
{
return BATADV_FORW_ALL;
}
@@ -85,7 +87,7 @@ batadv_mcast_forw_send_orig(struct batad
static inline int
batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
- unsigned short vid)
+ unsigned short vid, int is_routable)
{
kfree_skb(skb);
return NET_XMIT_DROP;
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -198,6 +198,7 @@ static netdev_tx_t batadv_interface_tx(s
int gw_mode;
enum batadv_forw_mode forw_mode = BATADV_FORW_SINGLE;
struct batadv_orig_node *mcast_single_orig = NULL;
+ int mcast_is_routable = 0;
int network_offset = ETH_HLEN;
__be16 proto;
@@ -300,7 +301,8 @@ static netdev_tx_t batadv_interface_tx(s
send:
if (do_bcast && !is_broadcast_ether_addr(ethhdr->h_dest)) {
forw_mode = batadv_mcast_forw_mode(bat_priv, skb,
- &mcast_single_orig);
+ &mcast_single_orig,
+ &mcast_is_routable);
if (forw_mode == BATADV_FORW_NONE)
goto dropped;
@@ -365,7 +367,8 @@ send:
ret = batadv_mcast_forw_send_orig(bat_priv, skb, vid,
mcast_single_orig);
} else if (forw_mode == BATADV_FORW_SOME) {
- ret = batadv_mcast_forw_send(bat_priv, skb, vid);
+ ret = batadv_mcast_forw_send(bat_priv, skb, vid,
+ mcast_is_routable);
} else {
if (batadv_dat_snoop_outgoing_arp_request(bat_priv,
skb))

View file

@ -0,0 +1,27 @@
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 2 Mar 2022 20:05:13 +0100
Subject: batman-adv: make mc_forwarding atomic
This fixes minor data-races in ip6_mc_input() and
batadv_mcast_mla_rtr_flags_softif_get_ipv6()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[sven@narfation.org: Add ugly hack to get it building with old kernels]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/56db7c0540e733a1f063ccd6bab1b537a80857eb
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -135,7 +135,11 @@ static u8 batadv_mcast_mla_rtr_flags_sof
{
struct inet6_dev *in6_dev = __in6_dev_get(dev);
+#if LINUX_VERSION_IS_GEQ(5, 18, 0) // UGLY_HACK_NEW
+ if (in6_dev && atomic_read(&in6_dev->cnf.mc_forwarding))
+#else // UGLY_HACK_OLD
if (in6_dev && in6_dev->cnf.mc_forwarding)
+#endif // UGLY_HACK_STOP
return BATADV_NO_FLAGS;
else
return BATADV_MCAST_WANT_NO_RTR6;

View file

@ -0,0 +1,23 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 15 Apr 2022 15:12:45 +0200
Subject: batman-adv: compat: Add atomic mc_fowarding support for stable kernels
Fixes: 56db7c0540e7 ("batman-adv: make mc_forwarding atomic")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/350adcaec82fbaa358a2406343b6130ac8dad126
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -135,7 +135,11 @@ static u8 batadv_mcast_mla_rtr_flags_sof
{
struct inet6_dev *in6_dev = __in6_dev_get(dev);
-#if LINUX_VERSION_IS_GEQ(5, 18, 0) // UGLY_HACK_NEW
+#if (LINUX_VERSION_IS_GEQ(5, 4, 189) && LINUX_VERSION_IS_LESS(5, 5, 0)) || /* UGLY_HACK */ \
+ (LINUX_VERSION_IS_GEQ(5, 10, 111) && LINUX_VERSION_IS_LESS(5, 11, 0)) || /* UGLY_HACK */ \
+ (LINUX_VERSION_IS_GEQ(5, 15, 34) && LINUX_VERSION_IS_LESS(5, 16, 0)) || /* UGLY_HACK */ \
+ (LINUX_VERSION_IS_GEQ(5, 16, 20) && LINUX_VERSION_IS_LESS(5, 17, 0)) || /* UGLY_HACK */ \
+ LINUX_VERSION_IS_GEQ(5, 17, 3) // UGLY_HACK_NEW
if (in6_dev && atomic_read(&in6_dev->cnf.mc_forwarding))
#else // UGLY_HACK_OLD
if (in6_dev && in6_dev->cnf.mc_forwarding)

View file

@ -0,0 +1,44 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Wed, 2 Mar 2022 19:49:44 +0100
Subject: batman-adv: Request iflink once in batadv-on-batadv check
There is no need to call dev_get_iflink multiple times for the same
net_device in batadv_is_on_batman_iface. And since some of the
.ndo_get_iflink callbacks are dynamic (for example via RCUs like in
vxcan_get_iflink), it could easily happen that the returned values are not
stable. The pre-checks before __dev_get_by_index are then of course bogus.
Fixes: 3d48811b27f5 ("batman-adv: prevent using any virtual device created on batman-adv as hard-interface")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/f6c0c45356fe3ab9c5e01b81d060f8a436658037
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -149,22 +149,23 @@ static bool batadv_is_on_batman_iface(co
struct net *net = dev_net(net_dev);
struct net_device *parent_dev;
struct net *parent_net;
+ int iflink;
bool ret;
/* check if this is a batman-adv mesh interface */
if (batadv_softif_is_valid(net_dev))
return true;
+ iflink = dev_get_iflink(net_dev);
+
/* no more parents..stop recursion */
- if (dev_get_iflink(net_dev) == 0 ||
- dev_get_iflink(net_dev) == net_dev->ifindex)
+ if (iflink == 0 || iflink == net_dev->ifindex)
return false;
parent_net = batadv_getlink_net(net_dev, net);
/* recurse over the parent device */
- parent_dev = __dev_get_by_index((struct net *)parent_net,
- dev_get_iflink(net_dev));
+ parent_dev = __dev_get_by_index((struct net *)parent_net, iflink);
/* if we got a NULL parent_dev there is something broken.. */
if (!parent_dev) {
pr_err("Cannot find parent device\n");

View file

@ -0,0 +1,46 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Wed, 2 Mar 2022 19:49:45 +0100
Subject: batman-adv: Request iflink once in batadv_get_real_netdevice
There is no need to call dev_get_iflink multiple times for the same
net_device in batadv_get_real_netdevice. And since some of the
ndo_get_iflink callbacks are dynamic (for example via RCUs like in
vxcan_get_iflink), it could easily happen that the returned values are not
stable. The pre-checks before __dev_get_by_index are then of course bogus.
Fixes: 2b45bb6c3aad ("batman-adv: additional checks for virtual interfaces on top of WiFi")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/445f477ec3e805425186f5fbe8ed0fe89cc226b6
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -215,14 +215,16 @@ static struct net_device *batadv_get_rea
struct net_device *real_netdev = NULL;
struct net *real_net;
struct net *net;
- int ifindex;
+ int iflink;
ASSERT_RTNL();
if (!netdev)
return NULL;
- if (netdev->ifindex == dev_get_iflink(netdev)) {
+ iflink = dev_get_iflink(netdev);
+
+ if (netdev->ifindex == iflink) {
dev_hold(netdev);
return netdev;
}
@@ -232,9 +234,8 @@ static struct net_device *batadv_get_rea
goto out;
net = dev_net(hard_iface->soft_iface);
- ifindex = dev_get_iflink(netdev);
real_net = batadv_getlink_net(netdev, net);
- real_netdev = dev_get_by_index(real_net, ifindex);
+ real_netdev = dev_get_by_index(real_net, iflink);
out:
if (hard_iface)

View file

@ -0,0 +1,86 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Wed, 2 Mar 2022 19:49:46 +0100
Subject: batman-adv: Don't expect inter-netns unique iflink indices
The ifindex doesn't have to be unique for multiple network namespaces on
the same machine.
$ ip netns add test1
$ ip -net test1 link add dummy1 type dummy
$ ip netns add test2
$ ip -net test2 link add dummy2 type dummy
$ ip -net test1 link show dev dummy1
6: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 96:81:55:1e:dd:85 brd ff:ff:ff:ff:ff:ff
$ ip -net test2 link show dev dummy2
6: dummy2: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 5a:3c:af:35:07:c3 brd ff:ff:ff:ff:ff:ff
But the batman-adv code to walk through the various layers of virtual
interfaces uses this assumption because dev_get_iflink handles it
internally and doesn't return the actual netns of the iflink. And
dev_get_iflink only documents the situation where ifindex == iflink for
physical devices.
But only checking for dev->netdev_ops->ndo_get_iflink is also not an option
because ipoib_get_iflink implements it even when it sometimes returns an
iflink != ifindex and sometimes iflink == ifindex. The caller must
therefore make sure itself to check both netns and iflink + ifindex for
equality. Only when they are equal, a "physical" interface was detected
which should stop the traversal. On the other hand, vxcan_get_iflink can
also return 0 in case there was currently no valid peer. In this case, it
is still necessary to stop.
Fixes: 3d48811b27f5 ("batman-adv: prevent using any virtual device created on batman-adv as hard-interface")
Fixes: 2b45bb6c3aad ("batman-adv: additional checks for virtual interfaces on top of WiFi")
Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/0aac7a9fbbbeec25f2f54a9e6d53ea91217ba720
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -157,13 +157,15 @@ static bool batadv_is_on_batman_iface(co
return true;
iflink = dev_get_iflink(net_dev);
-
- /* no more parents..stop recursion */
- if (iflink == 0 || iflink == net_dev->ifindex)
+ if (iflink == 0)
return false;
parent_net = batadv_getlink_net(net_dev, net);
+ /* iflink to itself, most likely physical device */
+ if (net == parent_net && iflink == net_dev->ifindex)
+ return false;
+
/* recurse over the parent device */
parent_dev = __dev_get_by_index((struct net *)parent_net, iflink);
/* if we got a NULL parent_dev there is something broken.. */
@@ -223,8 +225,7 @@ static struct net_device *batadv_get_rea
return NULL;
iflink = dev_get_iflink(netdev);
-
- if (netdev->ifindex == iflink) {
+ if (iflink == 0) {
dev_hold(netdev);
return netdev;
}
@@ -235,6 +236,14 @@ static struct net_device *batadv_get_rea
net = dev_net(hard_iface->soft_iface);
real_net = batadv_getlink_net(netdev, net);
+
+ /* iflink to itself, most likely physical device */
+ if (net == real_net && netdev->ifindex == iflink) {
+ real_netdev = netdev;
+ dev_hold(real_netdev);
+ goto out;
+ }
+
real_netdev = dev_get_by_index(real_net, iflink);
out:

View file

@ -0,0 +1,46 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 16 Apr 2022 14:24:34 +0200
Subject: batman-adv: Don't skb_split skbuffs with frag_list
The receiving interface might have used GRO to receive more fragments than
MAX_SKB_FRAGS fragments. In this case, these will not be stored in
skb_shinfo(skb)->frags but merged into the frag list.
batman-adv relies on the function skb_split to split packets up into
multiple smaller packets which are not larger than the MTU on the outgoing
interface. But this function cannot handle frag_list entries and is only
operating on skb_shinfo(skb)->frags. If it is still trying to split such an
skb and xmit'ing it on an interface without support for NETIF_F_FRAGLIST,
then validate_xmit_skb() will try to linearize it. But this fails due to
inconsistent information. And __pskb_pull_tail will trigger a BUG_ON after
skb_copy_bits() returns an error.
In case of entries in frag_list, just linearize the skb before operating on
it with skb_split().
Reported-by: Felix Kaechele <felix@kaechele.ca>
Tested-by: Felix Kaechele <felix@kaechele.ca>
Fixes: 9de347143505 ("batman-adv: layer2 unicast packet fragmentation")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/d467720acaf1b22b0cee58144eeaf9ef6c5e285c
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -477,6 +477,17 @@ int batadv_frag_send_packet(struct sk_bu
goto free_skb;
}
+ /* GRO might have added fragments to the fragment list instead of
+ * frags[]. But this is not handled by skb_split and must be
+ * linearized to avoid incorrect length information after all
+ * batman-adv fragments were created and submitted to the
+ * hard-interface
+ */
+ if (skb_has_frag_list(skb) && __skb_linearize(skb)) {
+ ret = -ENOMEM;
+ goto free_skb;
+ }
+
/* Create one header to be copied to all fragments */
frag_header.packet_type = BATADV_UNICAST_FRAG;
frag_header.version = BATADV_COMPAT_VERSION;

View file

@ -0,0 +1,43 @@
From: Shigeru Yoshida <syoshida@redhat.com>
Date: Sat, 20 Aug 2022 12:25:16 +0900
Subject: batman-adv: Fix hang up with small MTU hard-interface
The system hangs up when batman-adv soft-interface is created on
hard-interface with small MTU. For example, the following commands
create batman-adv soft-interface on dummy interface with zero MTU:
# ip link add name dummy0 type dummy
# ip link set mtu 0 dev dummy0
# ip link set up dev dummy0
# ip link add name bat0 type batadv
# ip link set dev dummy0 master bat0
These commands cause the system hang up with the following messages:
[ 90.578925][ T6689] batman_adv: bat0: Adding interface: dummy0
[ 90.580884][ T6689] batman_adv: bat0: The MTU of interface dummy0 is too small (0) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem.
[ 90.586264][ T6689] batman_adv: bat0: Interface activated: dummy0
[ 90.590061][ T6689] batman_adv: bat0: Forced to purge local tt entries to fit new maximum fragment MTU (-320)
[ 90.595517][ T6689] batman_adv: bat0: Forced to purge local tt entries to fit new maximum fragment MTU (-320)
[ 90.598499][ T6689] batman_adv: bat0: Forced to purge local tt entries to fit new maximum fragment MTU (-320)
This patch fixes this issue by returning error when enabling
hard-interface with small MTU size.
Fixes: 29a2a3dc52f4 ("hard interface rewrite")
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/a124b52ebab91ac416cf7ba05e671cbb860f30e8
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -729,6 +729,9 @@ int batadv_hardif_enable_interface(struc
int max_header_len = batadv_max_header_len();
int ret;
+ if (hard_iface->net_dev->mtu < ETH_MIN_MTU + max_header_len)
+ return -EINVAL;
+
if (hard_iface->if_status != BATADV_IF_NOT_IN_USE)
goto out;

166
bird1-openwrt/Makefile Normal file
View file

@ -0,0 +1,166 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Copyright (C) 2014-2017 Eloi Carbó <eloicaso@openmailbox.org>
# Copyright (C) 2022-2023 Roger Pueyo Centelles <roger.pueyo@guifi.net>
#
include $(TOPDIR)/rules.mk
BIRD1_PKG := bird1
BIRD1_IPV4_PKG := $(BIRD1_PKG)-ipv4
BIRD1_IPV6_PKG := $(BIRD1_PKG)-ipv6
BIRD4 := bird4
BIRD6 := bird6
PKG_NAME := $(BIRD1_PKG)-openwrt
PKG_IPV4_NAME := $(BIRD1_IPV4_PKG)-openwrt
PKG_IPV6_NAME := $(BIRD1_IPV6_PKG)-openwrt
PKG_VERSION := 0.3
PKG_RELEASE := 5
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE := GPL-3.0-or-later
PKG_UCI_NAME := $(BIRD1_PKG)-uci
PKG_LUCI_NAME := $(BIRD1_PKG)-luci
PKG_IPV4_UCI_NAME := $(BIRD1_IPV4_PKG)-uci
PKG_IPV6_UCI_NAME := $(BIRD1_IPV6_PKG)-uci
PKG_IPV4_LUCI_NAME := luci-app-$(BIRD1_IPV4_PKG)
PKG_IPV6_LUCI_NAME := luci-app-$(BIRD1_IPV6_PKG)
include $(INCLUDE_DIR)/package.mk
define Build/Prepare
endef
define Build/Compile
endef
define Package/$(PKG_UCI_NAME)/Default
TITLE:=The BIRD UCI module (v1.6)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
MAINTAINER:=Roger Pueyo Centelles <roger.pueyo@guifi.net>
URL:=https://github.com/openwrt/bird1-openwrt/
DEPENDS:=+libuci +uci
endef
define Package/$(PKG_LUCI_NAME)/Default
TITLE:=LuCI support for BIRD (v1.6)
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
MAINTAINER:=Roger Pueyo Centelles <roger.pueyo@guifi.net>
URL:=https://github.com/openwrt/bird1-openwrt/
DEPENDS:=+luci-base +luci-compat
endef
define Package/$(PKG_UCI_NAME)/description
$(BIRD1_PKG) UCI integration module
endef
define Package/$(PKG_LUCI_NAME)/description
$(BIRD1_PKG) application for LuCI
endef
define Package/$(PKG_IPV4_UCI_NAME)
$(call Package/$(PKG_UCI_NAME)/Default)
TITLE+= (IPv4)
DEPENDS+= +$(BIRD1_IPV4_PKG)
endef
define Package/$(PKG_IPV6_UCI_NAME)
$(call Package/$(PKG_UCI_NAME)/Default)
TITLE+= (IPv6)
DEPENDS+= +$(BIRD1_IPV6_PKG)
endef
define Package/$(PKG_IPV4_LUCI_NAME)
$(call Package/$(PKG_LUCI_NAME)/Default)
TITLE+= (IPv4)
DEPENDS+= +$(PKG_IPV4_UCI_NAME)
endef
define Package/$(PKG_IPV6_LUCI_NAME)
$(call Package/$(PKG_LUCI_NAME)/Default)
TITLE+= (IPv6)
DEPENDS+= +$(PKG_IPV6_UCI_NAME)
endef
define Package/$(PKG_IPV4_UCI_NAME)/conffiles
/etc/config/$(BIRD4)
endef
define Package/$(PKG_IPV6_UCI_NAME)/conffiles
/etc/config/$(BIRD6)
endef
define Package/$(PKG_IPV4_UCI_NAME)/install
$(INSTALL_DIR) $(1)/etc/$(BIRD4)/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/$(BIRD4)/filters
$(INSTALL_DIR) $(1)/etc/$(BIRD4)/functions
$(INSTALL_BIN) ./$(PKG_IPV4_NAME)/src/init.d/$(BIRD4)* $(1)/etc/$(BIRD4)/init.d/
$(CP) ./$(PKG_IPV4_NAME)/src/uci-defaults/* $(1)/etc/$(BIRD4)/init.d/
$(INSTALL_CONF) ./$(PKG_IPV4_NAME)/src/config/$(BIRD4) $(1)/etc/config/
endef
define Package/$(PKG_IPV6_UCI_NAME)/install
$(INSTALL_DIR) $(1)/etc/$(BIRD6)/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/$(BIRD6)/filters
$(INSTALL_DIR) $(1)/etc/$(BIRD6)/functions
$(INSTALL_BIN) ./$(PKG_IPV6_NAME)/src/init.d/$(BIRD6)* $(1)/etc/$(BIRD6)/init.d/
$(CP) ./$(PKG_IPV6_NAME)/src/uci-defaults/* $(1)/etc/$(BIRD6)/init.d/
$(INSTALL_CONF) ./$(PKG_IPV6_NAME)/src/config/$(BIRD6) $(1)/etc/config/
endef
define Package/$(PKG_IPV4_UCI_NAME)/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
( . /etc/$(BIRD4)/init.d/bird-uci-install-init.d $(BIRD4) ) && rm -f /etc/$(BIRD4)/init.d/bird-uci-install-init.d
( . /etc/$(BIRD4)/init.d/99-relocate-filters $(BIRD4) ) && rm -f /etc/$(BIRD4)/init.d/99-relocate-filters
if [ -f /etc/sysupgrade.conf ] && ! grep $(BIRD4) /etc/sysupgrade.conf; then
echo /etc/config/$(BIRD4) >> /etc/sysupgrade.conf
echo /etc/$(BIRD4)/filters/ >> /etc/sysupgrade.conf
echo /etc/$(BIRD4)/functions/ >> /etc/sysupgrade.conf
fi
fi
endef
define Package/$(PKG_IPV6_UCI_NAME)/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
( . /etc/$(BIRD6)/init.d/bird-uci-install-init.d $(BIRD6) ) && rm -f /etc/$(BIRD6)/init.d/bird-uci-install-init.d
( . /etc/$(BIRD6)/init.d/99-relocate-filters $(BIRD6) ) && rm -f /etc/$(BIRD6)/init.d/99-relocate-filters
if [ -f /etc/sysupgrade.conf ] && ! grep $(BIRD6) /etc/sysupgrade.conf; then
echo /etc/config/$(BIRD6) >> /etc/sysupgrade.conf
echo /etc/$(BIRD6)/filters/ >> /etc/sysupgrade.conf
echo /etc/$(BIRD6)/functions/ >> /etc/sysupgrade.conf
fi
fi
endef
$(eval $(call BuildPackage,$(PKG_IPV4_UCI_NAME)))
$(eval $(call BuildPackage,$(PKG_IPV6_UCI_NAME)))
define Package/$(PKG_IPV4_LUCI_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/$(BIRD4)/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/$(BIRD4)/
$(CP) ./$(PKG_IPV4_NAME)/src/model/* $(1)/usr/lib/lua/luci/model/cbi/$(BIRD4)/
$(CP) ./$(PKG_IPV4_NAME)/src/controller/* $(1)/usr/lib/lua/luci/controller/
$(CP) ./$(PKG_IPV4_NAME)/src/view/* $(1)/usr/lib/lua/luci/view/$(BIRD4)/
endef
define Package/$(PKG_IPV6_LUCI_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/$(BIRD6)/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/$(BIRD6)/
$(CP) ./$(PKG_IPV6_NAME)/src/model/* $(1)/usr/lib/lua/luci/model/cbi/$(BIRD6)/
$(CP) ./$(PKG_IPV6_NAME)/src/controller/* $(1)/usr/lib/lua/luci/controller/
$(CP) ./$(PKG_IPV6_NAME)/src/view/* $(1)/usr/lib/lua/luci/view/$(BIRD6)/
endef
$(eval $(call BuildPackage,$(PKG_IPV4_LUCI_NAME)))
$(eval $(call BuildPackage,$(PKG_IPV6_LUCI_NAME)))

View file

@ -1,103 +0,0 @@
# Copyright (C) 2014-2017 Eloi Carbo <eloicaso@openmailbox.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
BIRD := bird4
BIRD_PKG := bird1-ipv4
PKG_NAME := $(BIRD_PKG)-openwrt
PKG_VERSION := 0.3
PKG_RELEASE := 1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE := GPL-3.0+
uci := $(BIRD_PKG)-uci
luci := luci-app-$(BIRD_PKG)
include $(INCLUDE_DIR)/package.mk
define Build/Prepare
endef
define Build/Compile
endef
define Package/$(uci)
TITLE:=The BIRD UCI module (v1.6) (IPv4)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
MAINTAINER:=Eloi Carbo <eloicaso@openmailbox.org>
URL:=https://github.com/eloicaso/bird-openwrt/
DEPENDS:=+$(BIRD_PKG) +libuci +uci
endef
define Package/$(uci)/description
$(BIRD_PKG) UCI integration module
endef
define Package/$(uci)/conffiles
/etc/config/$(BIRD)
endef
define Package/$(uci)/install
$(INSTALL_DIR) $(1)/etc/$(BIRD)/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/$(BIRD)/filters
$(INSTALL_DIR) $(1)/etc/$(BIRD)/functions
$(INSTALL_BIN) ./src/init.d/$(BIRD)* $(1)/etc/$(BIRD)/init.d/
$(CP) ./src/uci-defaults/* $(1)/etc/$(BIRD)/init.d/
$(INSTALL_CONF) ./src/config/$(BIRD) $(1)/etc/config/
endef
define Package/$(uci)/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
( . /etc/$(BIRD)/init.d/bird-uci-install-init.d $(BIRD) ) && rm -f /etc/$(BIRD)/init.d/bird-uci-install-init.d
( . /etc/$(BIRD)/init.d/99-relocate-filters $(BIRD) ) && rm -f /etc/$(BIRD)/init.d/99-relocate-filters
if [ -f /etc/sysupgrade.conf ] && ! grep $(BIRD) /etc/sysupgrade.conf; then
echo /etc/config/$(BIRD) >> /etc/sysupgrade.conf
echo /etc/$(BIRD)/filters/ >> /etc/sysupgrade.conf
echo /etc/$(BIRD)/functions/ >> /etc/sysupgrade.conf
fi
fi
endef
$(eval $(call BuildPackage,$(uci)))
define Package/$(luci)
TITLE:=LuCI support for $(BIRD_PKG)
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
MAINTAINER:=Eloi Carbo <eloicaso@openmailbox.org>
URL:=https://github.com/eloicaso/bird-openwrt/
DEPENDS:=+$(BIRD_PKG)-uci +luci-base
endef
define Package/$(luci)/description
$(BIRD) application for LuCI
endef
define Package/$(luci)/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/$(BIRD)/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/$(BIRD)/
$(CP) ./src/model/* $(1)/usr/lib/lua/luci/model/cbi/$(BIRD)/
$(CP) ./src/controller/* $(1)/usr/lib/lua/luci/controller/
$(CP) ./src/view/* $(1)/usr/lib/lua/luci/view/$(BIRD)/
endef
$(eval $(call BuildPackage,$(luci)))

View file

@ -23,7 +23,7 @@ function index()
_("Bird4"), 0) _("Bird4"), 0)
entry({"admin", "network", "bird4", "status"}, entry({"admin", "network", "bird4", "status"},
cbi("bird4/status"), form("bird4/status"),
_("Status"), 0).leaf = true _("Status"), 0).leaf = true
entry({"admin","network","bird4","log"}, entry({"admin","network","bird4","log"},
@ -43,10 +43,10 @@ function index()
_("BGP Protocol"), 4).leaf = true _("BGP Protocol"), 4).leaf = true
entry({"admin","network","bird4","filters"}, entry({"admin","network","bird4","filters"},
cbi("bird4/filters"), form("bird4/filters"),
_("Filters"), 5).leaf = true _("Filters"), 5).leaf = true
entry({"admin","network","bird4","functions"}, entry({"admin","network","bird4","functions"},
cbi("bird4/functions"), form("bird4/functions"),
_("Functions"), 6).leaf = true _("Functions"), 6).leaf = true
end end

View file

@ -56,12 +56,15 @@ get() {
} }
# Function: get_bool $1 $2 # Function: get_a_bool $1 $2
# $1 boolean. $2 string # $1 boolean. $2 string
# This function uses the external UCI function "config_get_bool $result $section $option" to obtain a boolean value from UCI config file. # This function uses the external UCI function "config_get_bool $result $section $option" to obtain a boolean value from UCI config file.
# To use this function, use the same name of the UCI option for the variable $1. # To use this function, use the same name of the UCI option for the variable $1.
# Example: UCI (option use_ipv6 '1'); local use_ipv6; get use_ipv6 $section # Example: UCI (option use_ipv6 '1'); local use_ipv6; get use_ipv6 $section
get_bool() { # Note: this function was originally called get_bool(), but it collided with
# the get_bool() function provided by /lib/functions.sh. Read more at
# https://github.com/openwrt/routing/issues/920.
get_a_bool() {
config_get_bool $1 $2 $1 config_get_bool $1 $2 $1
} }
@ -201,7 +204,7 @@ prepare_kernel() {
local disabled; local table; local kernel_table; local import; local export local disabled; local table; local kernel_table; local import; local export
local scan_time; local persist; local learn local scan_time; local persist; local learn
get_bool disabled ${section} get_a_bool disabled ${section}
get table ${section} get table ${section}
get import ${section} get import ${section}
get export ${section} get export ${section}
@ -328,7 +331,7 @@ prepare_bgp_template() {
local import_limit; local import_limit_action; local export_limit; local export_limit_action local import_limit; local import_limit_action; local export_limit; local export_limit_action
local receive_limit; local receive_limit_action; local igp_table local receive_limit; local receive_limit_action; local igp_table
get_bool disabled ${section} get_a_bool disabled ${section}
get table ${section} get table ${section}
get import ${section} get import ${section}
get export ${section} get export ${section}
@ -338,8 +341,8 @@ prepare_bgp_template() {
get neighbor_address ${section} get neighbor_address ${section}
get neighbor_as ${section} get neighbor_as ${section}
get_bool next_hop_self ${section} get_a_bool next_hop_self ${section}
get_bool next_hop_keep ${section} get_a_bool next_hop_keep ${section}
get rr_client ${section} get rr_client ${section}
get rr_cluster_id ${section} get rr_cluster_id ${section}
@ -417,8 +420,8 @@ prepare_bgp() {
get receive_limit ${section} get receive_limit ${section}
get receive_limit_action ${section} get receive_limit_action ${section}
get_bool next_hop_self ${section} get_a_bool next_hop_self ${section}
get_bool next_hop_keep ${section} get_a_bool next_hop_keep ${section}
get rr_client ${section} get rr_client ${section}
get rr_cluster_id ${section} get rr_cluster_id ${section}

View file

@ -1,103 +0,0 @@
# Copyright (C) 2014-2017 Eloi Carbo <eloicaso@openmailbox.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
BIRD := bird6
BIRD_PKG := bird1-ipv6
PKG_NAME := $(BIRD_PKG)-openwrt
PKG_VERSION := 0.3
PKG_RELEASE := 1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE := GPL-3.0+
uci := $(BIRD_PKG)-uci
luci := luci-app-$(BIRD_PKG)
include $(INCLUDE_DIR)/package.mk
define Build/Prepare
endef
define Build/Compile
endef
define Package/$(uci)
TITLE:=The BIRD UCI module (v1.6) (IPv6)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
MAINTAINER:=Eloi Carbo <eloicaso@openmailbox.org>
URL:=https://github.com/eloicaso/bird-openwrt/
DEPENDS:=+$(BIRD_PKG) +libuci +uci
endef
define Package/$(uci)/description
$(BIRD_PKG) UCI integration module
endef
define Package/$(uci)/conffiles
/etc/config/$(BIRD)
endef
define Package/$(uci)/install
$(INSTALL_DIR) $(1)/etc/$(BIRD)/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/$(BIRD)/filters
$(INSTALL_DIR) $(1)/etc/$(BIRD)/functions
$(INSTALL_BIN) ./src/init.d/$(BIRD)* $(1)/etc/$(BIRD)/init.d/
$(CP) ./src/uci-defaults/* $(1)/etc/$(BIRD)/init.d/
$(INSTALL_CONF) ./src/config/$(BIRD) $(1)/etc/config/
endef
define Package/$(uci)/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
( . /etc/$(BIRD)/init.d/bird-uci-install-init.d $(BIRD) ) && rm -f /etc/$(BIRD)/init.d/bird-uci-install-init.d
( . /etc/$(BIRD)/init.d/99-relocate-filters $(BIRD) ) && rm -f /etc/$(BIRD)/init.d/99-relocate-filters
if [ -f /etc/sysupgrade.conf ] && ! grep $(BIRD) /etc/sysupgrade.conf; then
echo /etc/config/$(BIRD) >> /etc/sysupgrade.conf
echo /etc/$(BIRD)/filters/ >> /etc/sysupgrade.conf
echo /etc/$(BIRD)/functions/ >> /etc/sysupgrade.conf
fi
fi
endef
$(eval $(call BuildPackage,$(uci)))
define Package/$(luci)
TITLE:=LuCI support for $(BIRD_PKG)
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
MAINTAINER:=Eloi Carbo <eloicaso@openmailbox.org>
URL:=https://github.com/eloicaso/bird-openwrt/
DEPENDS:=+$(BIRD_PKG)-uci +luci-base
endef
define Package/$(luci)/description
$(BIRD) application for LuCI
endef
define Package/$(luci)/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/$(BIRD)/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/$(BIRD)/
$(CP) ./src/model/* $(1)/usr/lib/lua/luci/model/cbi/$(BIRD)/
$(CP) ./src/controller/* $(1)/usr/lib/lua/luci/controller/
$(CP) ./src/view/* $(1)/usr/lib/lua/luci/view/$(BIRD)/
endef
$(eval $(call BuildPackage,$(luci)))

View file

@ -23,7 +23,7 @@ function index()
_("Bird6"), 0) _("Bird6"), 0)
entry({"admin", "network", "bird6", "status"}, entry({"admin", "network", "bird6", "status"},
cbi("bird6/status"), form("bird6/status"),
_("Status"), 0).leaf = true _("Status"), 0).leaf = true
entry({"admin","network","bird6","log"}, entry({"admin","network","bird6","log"},
@ -43,10 +43,10 @@ function index()
_("BGP Protocol"), 4).leaf = true _("BGP Protocol"), 4).leaf = true
entry({"admin","network","bird6","filters"}, entry({"admin","network","bird6","filters"},
cbi("bird6/filters"), form("bird6/filters"),
_("Filters"), 5).leaf = true _("Filters"), 5).leaf = true
entry({"admin","network","bird6","functions"}, entry({"admin","network","bird6","functions"},
cbi("bird6/functions"), form("bird6/functions"),
_("Functions"), 6).leaf = true _("Functions"), 6).leaf = true
end end

View file

@ -57,12 +57,15 @@ get() {
} }
# Function: get_bool $1 $2 # Function: get_a_bool $1 $2
# $1 boolean. $2 string # $1 boolean. $2 string
# This function uses the external UCI function "config_get_bool $result $section $option" to obtain a boolean value from UCI config file. # This function uses the external UCI function "config_get_bool $result $section $option" to obtain a boolean value from UCI config file.
# To use this function, use the same name of the UCI option for the variable $1. # To use this function, use the same name of the UCI option for the variable $1.
# Example: UCI (option use_ipv6 '1'); local use_ipv6; get use_ipv6 $section # Example: UCI (option use_ipv6 '1'); local use_ipv6; get use_ipv6 $section
get_bool() { # Note: this function was originally called get_bool(), but it collided with
# the get_bool() function provided by /lib/functions.sh. Read more at
# https://github.com/openwrt/routing/issues/920.
get_a_bool() {
config_get_bool $1 $2 $1 config_get_bool $1 $2 $1
} }
@ -195,7 +198,7 @@ prepare_kernel() {
local disabled; local table; local kernel_table; local import; local export local disabled; local table; local kernel_table; local import; local export
local scan_time; local persist; local learn local scan_time; local persist; local learn
get_bool disabled ${section} get_a_bool disabled ${section}
get table ${section} get table ${section}
get import ${section} get import ${section}
get export ${section} get export ${section}
@ -322,9 +325,9 @@ prepare_bgp_template() {
local import_limit; local import_limit_action; local export_limit; local export_limit_action local import_limit; local import_limit_action; local export_limit; local export_limit_action
local receive_limit; local receive_limit_action; local igp_table local receive_limit; local receive_limit_action; local igp_table
get_bool disabled ${section} get_a_bool disabled ${section}
get_bool next_hop_self ${section} get_a_bool next_hop_self ${section}
get_bool next_hop_keep ${section} get_a_bool next_hop_keep ${section}
get table ${section} get table ${section}
get import ${section} get import ${section}
get export ${section} get export ${section}

View file

@ -7,17 +7,18 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=bird2 PKG_NAME:=bird2
PKG_VERSION:=2.0.7 PKG_VERSION:=2.13.1
PKG_RELEASE:=3 PKG_RELEASE:=1
PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird
PKG_HASH:=631d2b58aebdbd651aaa3c68c3756c02ebfe5b1e60d307771ea909eeaa5b1066 PKG_HASH:=97bb8d57be9bc5083e2b566416d27e314162856a12ca7c77e202e467d20d4080
PKG_BUILD_DEPENDS:=ncurses readline
PKG_MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
PKG_BUILD_DIR:=$(BUILD_DIR)/bird-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
PKG_LICENSE:=GPL-2.0-or-later
PKG_BUILD_DEPENDS:=ncurses readline
PKG_BUILD_DIR:=$(BUILD_DIR)/bird-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -96,7 +97,7 @@ protocols, telling BIRD to show various information, telling it to show
a routing table filtered by a filter, or asking BIRD to reconfigure. a routing table filtered by a filter, or asking BIRD to reconfigure.
endef endef
CONFIGURE_ARGS += --with-linux-headers="$(LINUX_DIR)" --disable-libssh CONFIGURE_ARGS += --disable-libssh
define Package/bird2/conffiles define Package/bird2/conffiles
/etc/bird.conf /etc/bird.conf

View file

@ -0,0 +1,11 @@
--- a/proto/ospf/topology.h
+++ b/proto/ospf/topology.h
@@ -41,7 +41,7 @@ struct top_hash_entry
u8 mode; /* LSA generated during RT calculation (LSA_RTCALC or LSA_STALE)*/
u8 nhs_reuse; /* Whether nhs nodes can be reused during merging.
See a note in rt.c:add_cand() */
-};
+} PACKED;
/* Prevents ospf_hash_find() to ignore the entry, for p->lsrqh and p->lsrth */

View file

@ -1,40 +0,0 @@
From 0ca3156f64a46c52c6d6fc913958f83970d3e57f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>
Date: Mon, 30 Apr 2018 11:13:02 +0200
Subject: [PATCH] babel: Set onlink flag for IPv4 routes with unreachable next
hop
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If the next hop of a route is not a reachable address, the route should be
installed as onlink. This enables a configuration common in mesh networks
where the mesh interface is assigned a /32 and babel handles the routing by
installing onlink routes.
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
---
proto/babel/babel.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index ce05191c..afd2eb19 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -640,6 +640,13 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e)
.nh.iface = r->neigh->ifa->iface,
};
+ /* If we cannot find a reachable neighbour, set the entry to be onlink. This
+ * makes it possible to, e.g., assign /32 addresses on a mesh interface and
+ * have routing work.
+ */
+ if (!neigh_find(&p->p, r->next_hop, r->neigh->ifa->iface, 0))
+ a0.nh.flags = RNF_ONLINK;
+
rta *a = rta_lookup(&a0);
rte *rte = rte_get_temp(a);
rte->u.babel.seqno = r->seqno;
--
2.17.0

View file

@ -1,30 +0,0 @@
From 4bbc10614f3431c37e6352f5a6ea5c693c31021e Mon Sep 17 00:00:00 2001
From: Maria Matejka <mq@ucw.cz>
Date: Tue, 4 Feb 2020 10:11:16 +0100
Subject: [PATCH] Added missing extern
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Thanks to Robert Scheck <bird@robert-scheck.de> who reported it
and Toke Høiland-Jørgensen <toke@toke.dk> who suggested this patch.
---
nest/route.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nest/route.h b/nest/route.h
index d2a07f09..b927db5f 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -458,7 +458,7 @@ typedef struct rta {
protocol-specific metric is availabe */
-const char * rta_dest_names[RTD_MAX];
+extern const char * rta_dest_names[RTD_MAX];
static inline const char *rta_dest_name(uint n)
{ return (n < RTD_MAX) ? rta_dest_names[n] : "???"; }
--
2.26.2

View file

@ -17,12 +17,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=cjdns PKG_NAME:=cjdns
PKG_VERSION:=v21 PKG_VERSION:=v21.1
PKG_RELEASE:=1 PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/cjdelisle/cjdns/tar.gz/$(PKG_NAME)-$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/cjdelisle/cjdns/tar.gz/$(PKG_NAME)-$(PKG_VERSION)?
PKG_HASH:=6dfb1fe18c9689324f36c8d33e660972aac5af4579fcaa9c4730179bc8d67c69 PKG_HASH:=a6158ce7847159aa44e86f74ccc7b6ded6910a230ed8f3830db53cda5838f0b0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=William Fleurant <meshnet@protonmail.com> PKG_MAINTAINER:=William Fleurant <meshnet@protonmail.com>
@ -81,7 +81,7 @@ define Build/Compile
CC="$(TARGET_CC)" \ CC="$(TARGET_CC)" \
AR="$(TARGET_AR)" \ AR="$(TARGET_AR)" \
RANLIB="$(TARGET_RANLIB)" \ RANLIB="$(TARGET_RANLIB)" \
CFLAGS="$(TARGET_CFLAGS) -U_FORTIFY_SOURCE" \ CFLAGS="$(TARGET_CFLAGS) -U_FORTIFY_SOURCE -Wno-error=array-bounds -Wno-error=stringop-overflow" \
LDFLAGS="$(TARGET_LDFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \
SYSTEM="linux" \ SYSTEM="linux" \
TARGET_ARCH="$(CONFIG_ARCH)" \ TARGET_ARCH="$(CONFIG_ARCH)" \

View file

@ -23,17 +23,10 @@ EOF
fi fi
# enable auto-peering on ethernet interface lan, if existing # enable auto-peering on ethernet interface lan, if existing
uci get network.lan | grep interface >/dev/null 2>&1 ifname=$(uci -q get network.lan.device || \
if [ $? -eq 0 ]; then ([ "$(uci -q get network.lan.type)" == "bridge" ] && echo br-lan) || \
uci get network.lan.type | grep bridge >/dev/null 2>&1 uci -q get network.lan.ifname)
if [ $? -eq 0 ]; then if [ -n "$ifname" ]; then
# most routers will set up an ethernet bridge for the lan
ifname="br-lan"
else
# docker containers don't have permission to create bridges by default,
# so we bind to the underlying interface instead (likely eth0)
ifname=`uci get network.lan.ifname`
fi
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
add cjdns eth_interface add cjdns eth_interface
set cjdns.@eth_interface[-1].beacon=2 set cjdns.@eth_interface[-1].beacon=2
@ -46,7 +39,7 @@ EOF
# create the network interface # create the network interface
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
set network.cjdns=interface set network.cjdns=interface
set network.cjdns.ifname=tuncjdns set network.cjdns.device=tuncjdns
set network.cjdns.proto=none set network.cjdns.proto=none
EOF EOF

View file

@ -53,6 +53,10 @@ function UCI.get()
obj.router.interface.tunDevice = config.tun_device obj.router.interface.tunDevice = config.tun_device
end end
cursor:foreach("cjdns", "supernodes", function(supernodes)
table.insert(obj.router.supernodes, supernodes.public_key)
end)
for i,section in pairs(obj.security) do for i,section in pairs(obj.security) do
if type(section.seccomp) == "number" then if type(section.seccomp) == "number" then
obj.security[i].seccomp = tonumber(config.seccomp) obj.security[i].seccomp = tonumber(config.seccomp)

View file

@ -1,13 +1,13 @@
--- a/node_build/builder.js --- a/node_build/builder.js
+++ b/node_build/builder.js +++ b/node_build/builder.js
@@ -215,8 +215,8 @@ var execJs = function (js, builder, file @@ -277,8 +277,8 @@ const execJs = function (js, ctx, file,
js = qs.join("'"); js = '"use strict";' + qs.join("'");
var to = setTimeout(function () { const to = setTimeout(function () {
- throw new Error("Inline JS did not return after 120 seconds [" + js + "]"); - throw new Error("Inline JS did not return after 120 seconds [" + js + "]");
- }, 120000); - }, 120000);
+ throw new Error("Inline JS did not return after 5 minutes [" + js + "]"); + throw new Error("Inline JS did not return after 5 minutes [" + js + "]");
+ }, 300000); + }, 300000);
var REQUIRE = function (str) { nThen(function (waitFor) {
if (typeof(str) !== 'string') {

View file

@ -1,11 +0,0 @@
--- a/memory/Allocator.c
+++ b/memory/Allocator.c
@@ -57,7 +57,7 @@ static void unroll(struct Allocator_pvt*
struct Allocator_Allocation_pvt* allocation = context->allocations;
while (allocation && includeAllocations) {
writeUnroller(&childUnroller);
- fprintf(stderr, "%s:%ld [%lu] bytes at [0x%lx]\n",
+ fprintf(stderr, "%s:%tu [%tu] bytes at [0x%lx]\n",
allocation->fileName,
allocation->lineNum,
allocation->pub.size,

View file

@ -0,0 +1,11 @@
--- a/node_build/FindPython.js
+++ b/node_build/FindPython.js
@@ -23,7 +23,7 @@ var Fs = require('fs');
// de-prioritize because the testing script accepts ANY python3 version
// (as of this writing, we don't know what python3 versions actually work)
// whereas we know that python2.7 is the only working python2 version.
-var PYTHONS = ["python3.7", "python3", "python2.7", "python2", "python"];
+var PYTHONS = ["python2", "python2.7", "python3.7", "python3.8", "python3.9", "python3"]
var SCRIPT = [
'import sys',

View file

@ -18,7 +18,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-cjdns PKG_NAME:=luci-app-cjdns
PKG_VERSION:=1.3 PKG_VERSION:=1.3
PKG_RELEASE:=8 PKG_RELEASE:=9
PKG_MAINTAINER:=William Fleurant <meshnet@protonmail.com> PKG_MAINTAINER:=William Fleurant <meshnet@protonmail.com>
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later

View file

@ -70,4 +70,13 @@ eth_peers:option(Value, "address", translate("MAC address")).datatype = "macaddr
eth_peers:option(Value, "public_key", translate("Public key")) eth_peers:option(Value, "public_key", translate("Public key"))
eth_peers:option(Value, "password", translate("Password")) eth_peers:option(Value, "password", translate("Password"))
-- Supernodes
supernodes = m:section(TypedSection, "supernodes", translate("List of Supernodes"),
translate("If none are specified they'll be taken from your peers"))
supernodes.anonymous = true
supernodes.addremove = true
supernodes.template = "cbi/tblsection"
supernodes:option(Value, "public_key", translate("Public Key")).size = 55
return m return m

View file

@ -10,10 +10,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=mcproxy PKG_NAME:=mcproxy
PKG_SOURCE_VERSION:=93b5ace42268160ebbfff4c61818fb15fa2d9b99 PKG_SOURCE_VERSION:=93b5ace42268160ebbfff4c61818fb15fa2d9b99
PKG_VERSION:=2017-08-24-$(PKG_SOURCE_VERSION) PKG_VERSION:=2017-08-24-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=2 PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/mcproxy/mcproxy.git PKG_SOURCE_URL:=https://github.com/mcproxy/mcproxy.git
PKG_MIRROR_HASH:=5779a78dedaef491825ada632fe6d8282067025dede41d0eede5c441893a2994
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org> PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=GPL-2.0+ PKG_LICENSE:=GPL-2.0+

View file

@ -1,7 +1,5 @@
Index: mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/mc_socket.cpp --- a/mcproxy/src/utils/mc_socket.cpp
=================================================================== +++ b/mcproxy/src/utils/mc_socket.cpp
--- mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99.orig/mcproxy/src/utils/mc_socket.cpp
+++ mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/mc_socket.cpp
@@ -37,6 +37,10 @@ @@ -37,6 +37,10 @@
#include <numeric> #include <numeric>
#include <unistd.h> #include <unistd.h>
@ -13,10 +11,8 @@ Index: mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/u
std::string ipAddrResolver(std::string ipAddr) std::string ipAddrResolver(std::string ipAddr)
{ {
std::string str[][2] = { std::string str[][2] = {
Index: mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/sourcefilter.cpp
===================================================================
--- /dev/null --- /dev/null
+++ mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/sourcefilter.cpp +++ b/mcproxy/src/utils/sourcefilter.cpp
@@ -0,0 +1,165 @@ @@ -0,0 +1,165 @@
+/* Get source filter. Linux version. +/* Get source filter. Linux version.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc. + Copyright (C) 2004-2014 Free Software Foundation, Inc.

View file

@ -1,7 +1,5 @@
Index: mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/proxy/proxy_instance.cpp --- a/mcproxy/src/proxy/proxy_instance.cpp
=================================================================== +++ b/mcproxy/src/proxy/proxy_instance.cpp
--- mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99.orig/mcproxy/src/proxy/proxy_instance.cpp
+++ mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/proxy/proxy_instance.cpp
@@ -171,6 +171,9 @@ void proxy_instance::worker_thread() @@ -171,6 +171,9 @@ void proxy_instance::worker_thread()
HC_LOG_TRACE(""); HC_LOG_TRACE("");
while (m_running) { while (m_running) {

63
mesh11sd/Makefile Normal file
View file

@ -0,0 +1,63 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# Copyright (C) 2022 BlueWave Projects and Services <licence@blue-wave.net>
#
include $(TOPDIR)/rules.mk
PKG_NAME:=mesh11sd
PKG_VERSION:=1.2.0
PKG_RELEASE:=$(AUTORELEASE)
PKG_MAINTAINER:=Rob White <rob@blue-wave.net>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/opennds/mesh11sd/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=b719eaacf63eb3684d0cd6a026f4357a4f400f2339f5d5a6cf74ba3744fe30d8
PKG_BUILD_DIR:=$(BUILD_DIR)/mesh11sd-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/mesh11sd
SUBMENU:=Captive Portals
SECTION:=net
CATEGORY:=Network
TITLE:=Dynamic 802.11s Mesh Configuration Daemon
PKGARCH:=all
URL:=https://github.com/opennds/mesh11sd
endef
define Package/mesh11sd/description
Mesh11sd is a dynamic parameter configuration daemon for 802.11s mesh networks.
It was originally designed to leverage 802.11s mesh networking at Captive Portal venues.
This is the open source version and it enables easy and automated mesh network operation with multiple mesh nodes.
It allows all mesh parameters supported by the wireless driver to be set in the uci config file.
Settings take effect immediately without having to restart the wireless network.
Default settings give rapid and reliable layer 2 mesh convergence.
Without mesh11sd, many mesh parameters cannot be set in the uci wireless config file as the mesh interface must be up before the parameters can be set.
Some of those that are supported, would fail to be implemented when the network is (re)started resulting in errors or dropped nodes.
The mesh11sd daemon dynamically checks configured parameters and sets them as required.
This version does not require a Captive Portal to be running.
endef
define Package/mesh11sd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mesh11sd $(1)/usr/sbin
$(INSTALL_CONF) $(PKG_BUILD_DIR)/linux_openwrt/mesh11sd/files/etc/config/mesh11sd $(1)/etc/config/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/linux_openwrt/mesh11sd/files/etc/init.d/mesh11sd $(1)/etc/init.d/
endef
define Package/mesh11sd/conffiles
/etc/config/mesh11sd
endef
define Build/Compile
endef
$(eval $(call BuildPackage,mesh11sd))

View file

@ -9,10 +9,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=minimalist-pcproxy PKG_NAME:=minimalist-pcproxy
PKG_SOURCE_VERSION:=2d6d1b0b0a3b79a9b4a9b0a7606a84600a967bcb PKG_SOURCE_VERSION:=2d6d1b0b0a3b79a9b4a9b0a7606a84600a967bcb
PKG_VERSION:=2015-01-12-$(PKG_SOURCE_VERSION) PKG_VERSION:=2015-01-12-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/fingon/minimalist-pcproxy.git PKG_SOURCE_URL:=https://github.com/fingon/minimalist-pcproxy.git
PKG_MIRROR_HASH:=d3e872ee6207829ef142d22d591d203e4836f6aa150167411b542e8df4af4d53
PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi> PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0

View file

@ -8,20 +8,20 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=mrd6 PKG_NAME:=mrd6
PKG_SOURCE_VERSION:=c805eb33255dbc0b6647d463c6c67d1c9d3105a0 PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=2013-11-30-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/hugosantos/mrd6.git PKG_SOURCE_URL:=https://github.com/hugosantos/mrd6.git
PKG_SOURCE_DATE:=2013-11-30
PKG_SOURCE_VERSION:=c805eb33255dbc0b6647d463c6c67d1c9d3105a0
PKG_MIRROR_HASH:=976243b967c18fcbf64d26158898245264c6d03d498826b104e6c92406a8f64f
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org> PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=GPL-2.0+ PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

50
naywatch/Makefile Normal file
View file

@ -0,0 +1,50 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021 Nick Hainke <vincent@systemli.org>
#
include $(TOPDIR)/rules.mk
PKG_NAME:=naywatch
PKG_VERSION:=1
PKG_RELEASE:=$(AUTORELEASE)
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
PKG_LICENSE:=GPL-2.0-only
include $(INCLUDE_DIR)/package.mk
define Package/naywatch
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Watchdog for IPv6 links
PKGARCH:=all
DEPENDS:=@IPV6 +owipcalc
endef
define Package/naywatch/description
Reboots or triggers watchdog if no link-local neighbor is available.
Important:
Be careful when you do a sysupgrade. Stop naywatch first, and make
sure procd took control again of the watchdog.
You can do this using 'ubus call system watchdog'. Status should be "running".
endef
define Package/naywatch/conffiles
/etc/config/naywatch
endef
define Build/Compile
endef
define Package/naywatch/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/naywatch.init $(1)/etc/init.d/naywatch
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./files/naywatch.sh $(1)/usr/bin/naywatch
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/naywatch.config $(1)/etc/config/naywatch
endef
$(eval $(call BuildPackage,naywatch))

View file

@ -0,0 +1,8 @@
config naywatch general
option check_interval '50'
option watchdog_timeout '60'
option use_watchdog '0'
option save_logs '1'
list interface 'lan'
list interface 'wan'
list save_cmd 'dmesg'

View file

@ -0,0 +1,89 @@
#!/bin/sh /etc/rc.common
. /usr/share/libubox/jshn.sh
USE_PROCD=1
START=95
STOP=01
log() {
local msg="$1"
logger -t naywatch "$msg"
}
wait_for_network()
{
ubus -t 15 wait_for network.interface.$1 2>/dev/null
}
boot()
{
local _interfaces
config_load naywatch
config_get _interfaces general interface
for interface in $_interfaces; do
wait_for_network interface
done
rc_procd start_service
}
start_service() {
procd_open_instance
config_load naywatch
local _check_interval
local _watchdog_timeout
local _use_watchdog
local _save_logs
local _interfaces
config_get _check_interval general "check_interval"
config_get _watchdog_timeout general "watchdog_timeout"
config_get _use_watchdog general "use_watchdog"
config_get _save_logs general "save_logs"
config_get _interfaces general "interface"
procd_set_param command /usr/bin/naywatch "$_check_interval" "$_watchdog_timeout" "$_use_watchdog" "$_save_logs" "$_interfaces"
procd_set_param respawn 3600 15 0
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
stop_service() {
exec 3>&- # close file again
sync && wait
}
watchdog_procd_runnig() {
watch=$(ubus call system watchdog)
json_load "$watch"
json_get_var watchdogstatus status
if [[ "$watchdogstatus" == "running" ]] ; then
echo "1"
return
fi
echo "0"
}
service_stopped() {
log "Naywatch Stopped!"
log "Try to handover watchdog to procd again."
for i in 1 2 3 4 5 6 7 8 9 10 ; do
sleep 5
ubus call system watchdog '{"stop":false}' > /dev/null
if [[ $(watchdog_procd_runnig) == "1" ]] ; then
break
fi
done
if [[ $(watchdog_procd_runnig) == "1" ]] ; then
log "Handover sucessfully!"
else
log "Handover to procd failed! Device can reboot!"
fi
}

125
naywatch/files/naywatch.sh Normal file
View file

@ -0,0 +1,125 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/network.sh
CHECK_INTERVAL=$1
shift
WATCHDOG_TIMEOUT=$1
shift
USE_WATCHDOG=$1
shift
SAVE_LOGS=$1
shift
INTERFACES="$*"
ACTIVE=0
NO_NEIGHBORS_COUNT=0
MIN_KICK=5
log() {
local msg="$1"
logger -t naywatch "$msg"
}
write_logs() {
save_log() {
eval $1 > /root/$(date +%s)-"$1".log
}
config_load naywatch
config_list_foreach general save_cmd save_log
sync
}
neighbors_available() {
local phy
for interface in $INTERFACES; do
network_get_physdev phy $interface > /dev/null 2>&1
linklocal=$(ip -6 a list dev $phy | grep "scope link" | awk '{print $2}' | sed 's/\/64//') 2> /dev/null
ips=$(ping ff02::1%$phy -w5 -W5 -c2 | awk '/from/{print($4)}' | sed 's/.$//') 2> /dev/null
for ip in $ips; do
if [ $ip != $linklocal ] && [ $(owipcalc $ip linklocal) -eq 1 ]; then
echo 1
return 0
fi
done
done
echo 0
}
activate_watchdog() {
# disable openwrt instrumentation:
ubus call system watchdog '{"magicclose":true,"stop":true,"timeout":'${WATCHDOG_TIMEOUT}'}' > /dev/null
exec 3>/dev/watchdog
}
reboot_now() {
# copied from watch-cat
reboot &
[ "$1" -ge 1 ] && {
sleep "$1"
echo 1 >/proc/sys/kernel/sysrq
echo b >/proc/sysrq-trigger
}
}
no_neighbors() {
log "No Neighbors Available!"
NO_NEIGHBORS_COUNT=$(($NO_NEIGHBORS_COUNT+1))
if [ $ACTIVE -eq 0 ]; then
return 0
fi
if [ $SAVE_LOGS -eq 1 ]; then
log "Saving Logs!"
write_logs
fi
if [ $USE_WATCHDOG -eq 0 ] && [ $NO_NEIGHBORS_COUNT -gt $MIN_KICK ]; then
reboot_now 10
fi
}
log "Naywatch Started!"
neighbors() {
if [ $ACTIVE -eq 0 ]; then
log "Naywatch Activated!"
fi
ACTIVE=1
NO_NEIGHBORS_COUNT=0
if [ $USE_WATCHDOG -eq 1 ]; then
echo 1 >&3
fi
}
not_active() {
if [ $USE_WATCHDOG -eq 1 ]; then
echo 1 >&3
fi
}
if [ $USE_WATCHDOG -eq 1 ]; then
activate_watchdog
fi
while [ 1 ]; do
# first sleep
sleep $CHECK_INTERVAL
has_neighbor=$(neighbors_available)
if [ $has_neighbor -eq 0 ] && [ $ACTIVE -eq 1 ]; then
no_neighbors
elif [ $has_neighbor -eq 1 ]; then
neighbors
else
not_active
fi
done
exit 0

View file

@ -6,59 +6,57 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=nodogsplash PKG_NAME:=nodogsplash
PKG_FIXUP:=autoreconf PKG_VERSION:=5.0.2
PKG_VERSION:=5.0.0
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)?
PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz PKG_HASH:=908d3674e93726fdcefb4c3b6705c745753435df9d46425781a57e3f6b417797
PKG_HASH:=a7665f4a42997746a31e9217f2f54e360aa7fc4bc72bd89faa08f1ccf7875b5e
PKG_BUILD_DIR:=$(BUILD_DIR)/nodogsplash-$(PKG_VERSION)
PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de> PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0+
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/nodogsplash define Package/nodogsplash
SUBMENU:=Captive Portals SUBMENU:=Captive Portals
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
DEPENDS:=+libpthread +iptables-mod-ipopt +libmicrohttpd-no-ssl DEPENDS:=+libpthread +libmicrohttpd-no-ssl +iptables-nft \
TITLE:=Open public network gateway daemon +iptables-mod-nat-extra +iptables-mod-ipopt \
URL:=https://github.com/nodogsplash/nodogsplash +iptables-mod-conntrack-extra
CONFLICTS:=nodogsplash2 TITLE:=Open public network gateway daemon
URL:=https://github.com/nodogsplash/nodogsplash
endef endef
define Package/nodogsplash/description define Package/nodogsplash/description
Nodogsplash is a Captive Portal that offers a simple way to Nodogsplash is a Captive Portal that offers a simple way to
provide restricted access to the Internet by showing a splash provide restricted access to the Internet by showing a splash
page to the user before Internet access is granted. page to the user before Internet access is granted.
It also incorporates an API that allows the creation of
sophisticated authentication applications.
endef endef
define Package/nodogsplash/install define Package/nodogsplash/install
$(INSTALL_DIR) $(1)/usr/lib/nodogsplash
$(INSTALL_BIN) ./files/usr/lib/nodogsplash/restart.sh $(1)/usr/lib/nodogsplash/
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nodogsplash $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/nodogsplash $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ndsctl $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/ndsctl $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/nodogsplash/htdocs/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/resources/splash.html $(1)/etc/nodogsplash/htdocs/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/resources/splash.css $(1)/etc/nodogsplash/htdocs/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/resources/status.html $(1)/etc/nodogsplash/htdocs/
$(INSTALL_DIR) $(1)/etc/nodogsplash/htdocs/images $(INSTALL_DIR) $(1)/etc/nodogsplash/htdocs/images
$(INSTALL_DATA) $(PKG_BUILD_DIR)/resources/splash.jpg $(1)/etc/nodogsplash/htdocs/images/
$(INSTALL_DIR) $(1)/etc/config $(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/etc/config/nodogsplash $(1)/etc/config/
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/nodogsplash $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/usr/lib/nodogsplash $(INSTALL_BIN) ./files/etc/uci-defaults/40_nodogsplash $(1)/etc/uci-defaults/
$(CP) $(PKG_BUILD_DIR)/resources/splash.html $(1)/etc/nodogsplash/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/splash.css $(1)/etc/nodogsplash/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/status.html $(1)/etc/nodogsplash/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/splash.jpg $(1)/etc/nodogsplash/htdocs/images/
$(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/config/nodogsplash $(1)/etc/config/
$(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/init.d/nodogsplash $(1)/etc/init.d/
$(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/uci-defaults/40_nodogsplash $(1)/etc/uci-defaults/
$(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/usr/lib/nodogsplash/restart.sh $(1)/usr/lib/nodogsplash/
endef endef
define Package/nodogsplash/postrm define Package/nodogsplash/postrm

View file

@ -0,0 +1,152 @@
# The options available here are an adaptation of the settings used in nodogsplash.conf.
# See https://github.com/nodogsplash/nodogsplash/blob/master/resources/nodogsplash.conf
config nodogsplash
# Set to 0 to disable nodogsplash
option enabled 1
# Set to 0 to disable hook that makes nodogsplash restart when the firewall restarts.
# This hook is needed as a restart of Firewall overwrites nodogsplash iptables entries.
option fwhook_enabled '1'
# WebRoot
# Default: /etc/nodogsplash/htdocs
#
# The local path where the splash page content resides.
# ie. Serve the file splash.html from this directory
#option webroot '/etc/nodogsplash/htdocs'
# Use plain configuration file
#option config '/etc/nodogsplash/nodogsplash.conf'
# Use this option to set the device nodogsplash will bind to.
# The value may be an interface section in /etc/config/network or a device name such as br-lan.
option gatewayinterface 'br-lan'
# GatewayPort
# Default: 2050
#
# Nodogsplash's own http server uses gateway address as its IP address.
# The port it listens to at that IP can be set here; default is 2050.
#
#option gatewayport '2050'
option gatewayname 'OpenWrt Nodogsplash'
option maxclients '250'
# Enables debug output (0-3)
#option debuglevel '1'
# Client timeouts in minutes
option preauthidletimeout '30'
option authidletimeout '120'
# Session Timeout is the interval after which clients are forced out (a value of 0 means never)
option sessiontimeout '1200'
# The interval in seconds at which nodogsplash checks client timeout status
option checkinterval '600'
# Enable BinAuth Support.
# If set, a program is called with several parameters on authentication (request) and deauthentication.
# Request for authentication:
# $<BinAuth> auth_client <client_mac> '<username>' '<password>'
#
# The username and password values may be empty strings and are URL encoded.
# The program is expected to output the number of seconds the client
# is to be authenticated. Zero or negative seconds will cause the authentification request
# to be rejected. The same goes for an exit code that is not 0.
# The output may contain a user specific download and upload limit in KBit/s:
# <seconds> <upload> <download>
#
# Called on authentication or deauthentication:
# $<BinAuth> <*auth|*deauth> <incoming_bytes> <outgoing_bytes> <session_start> <session_end>
#
# "client_auth": Client authenticated via this script.
# "client_deauth": Client deauthenticated by the client via splash page.
# "idle_deauth": Client was deauthenticated because of inactivity.
# "timeout_deauth": Client was deauthenticated because the session timed out.
# "ndsctl_auth": Client was authenticated manually by the ndsctl tool.
# "ndsctl_deauth": Client was deauthenticated by the ndsctl tool.
# "shutdown_deauth": Client was deauthenticated by Nodogsplash terminating.
#
# Values session_start and session_start are in seconds since 1970 or 0 for unknown/unlimited.
#
#option binauth '/bin/myauth.sh'
# Enable PreAuth Support.
#
# A simple login script is provided in the package.
# This generates a login page asking for usename and email address.
# User logins are recorded in the log file /tmp/ndslog.log
# Details of how the script works are contained in comments in the script itself.
#
# The Preauth program will output html code that will be served to the client by NDS
# Using html GET the Preauth program may call:
# /nodogsplash_preauth/ to ask the client for more information
# or
# /nodogsplash_auth/ to authenticate the client
#
# The Preauth program should append at least the client ip to the query string
# (using html input type hidden) for all calls to /nodogsplash_preauth/
# It must also obtain the client token using ndsctl (or the original query string if fas_secure_enabled=0)
# for NDS authentication when calling /nodogsplash_auth/
#
#option preauth '/usr/lib/nodogsplash/login.sh'
# Your router may have several interfaces, and you
# probably want to keep them private from the gatewayinterface.
# If so, you should block the entire subnets on those interfaces, e.g.:
#list authenticated_users 'block to 192.168.0.0/16'
#list authenticated_users 'block to 10.0.0.0/8'
# Typical ports you will probably want to open up.
#list authenticated_users 'allow tcp port 22'
#list authenticated_users 'allow tcp port 53'
#list authenticated_users 'allow udp port 53'
#list authenticated_users 'allow tcp port 80'
#list authenticated_users 'allow tcp port 443'
# Or for happy customers allow all
list authenticated_users 'allow all'
# For preauthenticated users to resolve IP addresses in their
# initial request not using the router itself as a DNS server,
# Leave commented to help prevent DNS tunnelling
#list preauthenticated_users 'allow tcp port 53'
#list preauthenticated_users 'allow udp port 53'
# Allow ports for SSH/Telnet/DNS/DHCP/HTTP/HTTPS
list users_to_router 'allow tcp port 22'
list users_to_router 'allow tcp port 23'
list users_to_router 'allow tcp port 53'
list users_to_router 'allow udp port 53'
list users_to_router 'allow udp port 67'
list users_to_router 'allow tcp port 80'
# MAC addresses that are / are not allowed to access the splash page
# Value is either 'allow' or 'block'. The allowedmac or blockedmac list is used.
#option macmechanism 'allow'
#list allowedmac '00:00:C0:01:D0:0D'
#list allowedmac '00:00:C0:01:D0:1D'
#list blockedmac '00:00:C0:01:D0:2D'
# MAC addresses that do not need to authenticate
#list trustedmac '00:00:C0:01:D0:1D'
# Nodogsplash uses specific HEXADECIMAL values to mark packets used by iptables as a bitwise mask.
# This mask can conflict with the requirements of other packages such as mwan3, sqm etc
# Any values set here are interpreted as in hex format.
#
# List: fw_mark_authenticated
# Default: 30000 (0011|0000|0000|0000|0000 binary)
#
# List: fw_mark_trusted
# Default: 20000 (0010|0000|0000|0000|0000 binary)
#
# List: fw_mark_blocked
# Default: 10000 (0001|0000|0000|0000|0000 binary)
#
#option fw_mark_authenticated '30000'
#option fw_mark_trusted '20000'
#option fw_mark_blocked '10000'

View file

@ -0,0 +1,215 @@
#!/bin/sh /etc/rc.common
#
# Startup/shutdown script for nodogsplash captive portal
#
START=95
STOP=95
USE_PROCD=1
IPT=/usr/sbin/iptables
WD_DIR=/usr/bin
# Run in PROCD (-f) and log to SYSLOG (-s)
OPTIONS="-f -s"
#
CONFIG=""
addline() {
append CONFIG "$1" "$N"
}
setup_mac_lists() {
local cfg="$1"
local macs=""
local val
append_mac() {
append macs "$1" ","
}
config_get val "$cfg" macmechanism
if [ -z "$val" ]; then
# Check if we have AllowedMACList or BlockedMACList defined they will be ignored
config_get val "$cfg" allowedmac
if [ -n "$val" ]; then
echo "Ignoring allowedmac - macmechanism not \"allow\"" >&2
fi
config_get val "$cfg" blockedmac
if [ -n "$val" ]; then
echo "Ignoring blockedmac - macmechanism not \"block\"" >&2
fi
elif [ "$val" = "allow" ]; then
config_list_foreach "$cfg" allowedmac append_mac
addline "MACmechanism allow"
addline "AllowedMACList $macs"
elif [ "$val" = "block" ]; then
config_list_foreach "$cfg" blockedmac append_mac
addline "MACmechanism block"
addline "BlockedMACList $macs"
else
echo "Invalid macmechanism '$val' - allow or block are valid." >&2
return 1
fi
macs=""
config_list_foreach "$cfg" trustedmac append_mac
if [ -n "$macs" ]; then
addline "TrustedMACList $macs"
fi
return 0
}
setup_firewall() {
local cfg="$1"
local uci_name
local val
append_firewall() {
addline " FirewallRule $1"
}
for rule in authenticated-users preauthenticated-users users-to-router trusted-users trusted-users-to-router; do
# uci does not allow dashes
uci_name=${rule//-/_}
addline "FirewallRuleSet $rule {"
config_list_foreach "$cfg" "$uci_name" append_firewall
addline "}"
config_get val "$cfg" "policy_${uci_name}"
if [ -n "$val" ]; then
addline "EmptyRuleSetPolicy $rule $val"
fi
done
}
wait_for_interface() {
local ifname="$1"
local timeout=10
for i in $(seq $timeout); do
if [ $(ip -4 addr show dev $ifname 2> /dev/null | grep -c inet) -ne 0 ]; then
break
fi
sleep 1
if [ $i = $timeout ]; then
echo "Interface $ifname not detected." >&2
return 1
fi
done
return 0
}
generate_uci_config() {
local cfg="$1"
local val
local ifname
local download
local upload
# Init config file content
CONFIG="# auto-generated config file from /etc/config/nodogsplash"
config_get val "$cfg" config
if [ -n "$val" ]; then
if [ ! -f "$val" ]; then
echo "Configuration file '$file' doesn't exist." >&2
return 1
fi
addline "$(cat $val)"
fi
config_get ifname "$cfg" gatewayinterface
# Get device name if interface name is a section name in /etc/config/network
if network_get_device tmp "$ifname"; then
ifname="$tmp"
fi
if [ -z "$ifname" ]; then
echo "Option network or gatewayinterface missing." >&2
return 1
fi
wait_for_interface "$ifname" || return 1
addline "GatewayInterface $ifname"
for option in preauth binauth \
daemon debuglevel maxclients gatewayname gatewayinterface gatewayiprange \
gatewayaddress gatewayport webroot splashpage statuspage \
redirecturl sessiontimeout preauthidletimeout authidletimeout checkinterval \
setmss mssvalue trafficcontrol downloadlimit uploadlimit \
syslogfacility ndsctlsocket fw_mark_authenticated \
fw_mark_blocked fw_mark_trusted
do
config_get val "$cfg" "$option"
if [ -n "$val" ]; then
addline "$option $val"
fi
done
for option in fasport fasremoteip faspath fas_secure_enabled ; do
config_get val "$cfg" "$option"
if [ -n "$val" ]; then
echo "Warning: nodogsplash does not support $val"
return 1
fi
done
config_get download "$cfg" downloadlimit
config_get upload "$cfg" uploadlimit
if [ -n "$upload" -o -n "$download" ]; then
addline "TrafficControl yes"
fi
setup_mac_lists "$cfg" || return 1
setup_firewall "$cfg"
echo "$CONFIG" > "/tmp/etc/nodogsplash_$cfg.conf"
return 0
}
# setup configuration and start instance
create_instance() {
local cfg="$1"
local val
config_get_bool val "$cfg" enabled 0
[ $val -gt 0 ] || return 0
if ! generate_uci_config "$cfg"; then
echo "Can not generate uci config. Will not start instance $cfg." >&2
return 1
fi
procd_open_instance $cfg
procd_set_param command /usr/bin/nodogsplash -c "/tmp/etc/nodogsplash_$cfg.conf" $OPTIONS
procd_set_param respawn
procd_set_param file "/tmp/etc/nodogsplash_$cfg.conf"
procd_close_instance
}
start_service() {
# For network_get_device()
include /lib/functions
# For nodogsplash.conf file
mkdir -p /tmp/etc/
config_load nodogsplash
config_foreach create_instance nodogsplash
}
stop_service() {
# When procd terminates nodogsplash, it does not exit fast enough.
# Otherwise procd will restart nodogsplash twice. First time starting
# nodogsplash fails, second time it succeeds.
sleep 1
}

View file

@ -0,0 +1,9 @@
#!/bin/sh
uci -q batch <<-EOF
delete firewall.nodogsplash
set firewall.nodogsplash=include
set firewall.nodogsplash.type=script
set firewall.nodogsplash.path=/usr/lib/nodogsplash/restart.sh
commit firewall
EOF

View file

@ -0,0 +1,8 @@
#!/bin/sh
# Check if nodogsplash is running
if ndsctl status &> /dev/null; then
if [ "$(uci -q get nodogsplash.@nodogsplash[0].fwhook_enabled)" = "1" ]; then
/etc/init.d/nodogsplash restart
fi
fi

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ohybridproxy PKG_NAME:=ohybridproxy
PKG_SOURCE_VERSION:=0dfef1eb5f067250a5f24a899536879ea4fdc4c5 PKG_SOURCE_VERSION:=0dfef1eb5f067250a5f24a899536879ea4fdc4c5
PKG_SOURCE_DATE:=2020-05-22 PKG_SOURCE_DATE:=2020-05-22
PKG_RELEASE:=2 PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/sbyx/ohybridproxy.git PKG_SOURCE_URL:=https://github.com/sbyx/ohybridproxy.git
@ -24,9 +24,6 @@ PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk include $(INCLUDE_DIR)/cmake.mk
# Spammy debug builds for now
CMAKE_OPTIONS += -DL_LEVEL=7
define Package/ohybridproxy define Package/ohybridproxy
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network

View file

@ -1,21 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# #
# Copyright (C) 2009-2016 OpenWrt.org # Copyright (C) 2009-2016 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=olsrd PKG_NAME:=olsrd
PKG_SOURCE_DATE:=2020-06-18 PKG_SOURCE_DATE:=2021-06-12
PKG_RELEASE:=3 PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/OLSR/olsrd.git PKG_SOURCE_URL:=https://github.com/OLSR/olsrd.git
PKG_SOURCE_VERSION:=84400e5cf56590cd2bd5bef2d224104d1bac4252 PKG_SOURCE_VERSION:=4973feb538b5b98b9d8ac2f8f474202f6d73de78
PKG_MIRROR_HASH:=0511743e53505107fdb38fe1b355e145cd7bc1aa409dd0a6a2815bb14b63af73 PKG_MIRROR_HASH:=705ff34d7ce13f59004b7fc91d852b8a6982538b58a78f4dfa552e212c1026eb
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
PKG_BUILD_PARALLEL:=0 PKG_BUILD_PARALLEL:=0
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
@ -35,7 +34,7 @@ endef
define Package/olsrd define Package/olsrd
$(call Package/olsrd/template) $(call Package/olsrd/template)
MENU:=1 MENU:=1
DEPENDS:=+libpthread DEPENDS:=+libpthread +libubus
endef endef
define Package/olsrd/conffiles define Package/olsrd/conffiles
@ -55,6 +54,13 @@ define Package/olsrd-mod-dot-draw
TITLE:=Dot topology information plugin TITLE:=Dot topology information plugin
endef endef
define Package/olsrd-mod-filtergw
$(call Package/olsrd/template)
DEPENDS:=olsrd
TITLE:=Filter Gateway plugin
endef
define Package/olsrd-mod-bmf define Package/olsrd-mod-bmf
$(call Package/olsrd/template) $(call Package/olsrd/template)
DEPENDS:=olsrd +kmod-tun DEPENDS:=olsrd +kmod-tun
@ -151,6 +157,12 @@ define Package/olsrd-mod-watchdog
TITLE:=Watchdog plugin TITLE:=Watchdog plugin
endef endef
define Package/olsrd-utils
$(call Package/olsrd/template)
DEPENDS:=olsrd
TITLE:=Utils for OLSRD
endef
define Package/olsrd-mod-pud/conffiles define Package/olsrd-mod-pud/conffiles
/etc/olsrd.d/olsrd.pud.position.conf /etc/olsrd.d/olsrd.pud.position.conf
endef endef
@ -169,7 +181,7 @@ MAKE_FLAGS+= \
DESTDIR="$(PKG_INSTALL_DIR)" \ DESTDIR="$(PKG_INSTALL_DIR)" \
STRIP="true" \ STRIP="true" \
INSTALL_LIB="true" \ INSTALL_LIB="true" \
SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo jsoninfo netjson mdns nameservice p2pd pgraph pud quagga secure sgwdynspeed txtinfo watchdog" SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo filtergw jsoninfo netjson mdns nameservice p2pd pgraph pud quagga secure sgwdynspeed txtinfo watchdog"
define Build/Compile define Build/Compile
$(call Build/Compile/Default,all) $(call Build/Compile/Default,all)
@ -178,7 +190,7 @@ endef
define Package/olsrd/install define Package/olsrd/install
$(INSTALL_DIR) $(1)/lib/functions $(INSTALL_DIR) $(1)/lib/functions
$(INSTALL_DATA) ./files/olsrd.init $(1)/lib/functions/olsrd.sh $(INSTALL_DATA) ./files/olsrd.sh $(1)/lib/functions/olsrd.sh
$(INSTALL_DIR) $(1)/etc/config $(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd $(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd
$(INSTALL_DATA) ./files/olsrd6.config $(1)/etc/config/olsrd6 $(INSTALL_DATA) ./files/olsrd6.config $(1)/etc/config/olsrd6
@ -187,8 +199,6 @@ define Package/olsrd/install
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/olsrd4.init $(1)/etc/init.d/olsrd $(INSTALL_BIN) ./files/olsrd4.init $(1)/etc/init.d/olsrd
$(INSTALL_BIN) ./files/olsrd6.init $(1)/etc/init.d/olsrd6 $(INSTALL_BIN) ./files/olsrd6.init $(1)/etc/init.d/olsrd6
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/olsrd.hotplug.sh $(1)/etc/hotplug.d/iface/50-olsrd
endef endef
define Package/olsrd-mod-arprefresh/install define Package/olsrd-mod-arprefresh/install
@ -196,6 +206,11 @@ define Package/olsrd-mod-arprefresh/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/
endef endef
define Package/olsrd-mod-filtergw/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/filtergw/olsrd_filtergw.so.* $(1)/usr/lib/
endef
define Package/olsrd-mod-dot-draw/install define Package/olsrd-mod-dot-draw/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/
@ -289,9 +304,15 @@ define Package/olsrd-mod-watchdog/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/watchdog/olsrd_watchdog.so.* $(1)/usr/lib/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/watchdog/olsrd_watchdog.so.* $(1)/usr/lib/
endef endef
define Package/olsrd-utils/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./files/olsrd-neigh.sh $(1)/usr/bin/olsrd-neigh
endef
$(eval $(call BuildPackage,olsrd)) $(eval $(call BuildPackage,olsrd))
$(eval $(call BuildPackage,olsrd-mod-arprefresh)) $(eval $(call BuildPackage,olsrd-mod-arprefresh))
$(eval $(call BuildPackage,olsrd-mod-dot-draw)) $(eval $(call BuildPackage,olsrd-mod-dot-draw))
$(eval $(call BuildPackage,olsrd-mod-filtergw))
$(eval $(call BuildPackage,olsrd-mod-bmf)) $(eval $(call BuildPackage,olsrd-mod-bmf))
$(eval $(call BuildPackage,olsrd-mod-dyn-gw)) $(eval $(call BuildPackage,olsrd-mod-dyn-gw))
$(eval $(call BuildPackage,olsrd-mod-dyn-gw-plain)) $(eval $(call BuildPackage,olsrd-mod-dyn-gw-plain))
@ -308,3 +329,4 @@ $(eval $(call BuildPackage,olsrd-mod-secure))
$(eval $(call BuildPackage,olsrd-mod-sgwdynspeed)) $(eval $(call BuildPackage,olsrd-mod-sgwdynspeed))
$(eval $(call BuildPackage,olsrd-mod-txtinfo)) $(eval $(call BuildPackage,olsrd-mod-txtinfo))
$(eval $(call BuildPackage,olsrd-mod-watchdog)) $(eval $(call BuildPackage,olsrd-mod-watchdog))
$(eval $(call BuildPackage,olsrd-utils))

109
olsrd/files/olsrd-neigh.sh Executable file
View file

@ -0,0 +1,109 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
hostsfile_getname()
{
local config="$1"
local i=0
local value file
while value="$( uci -q get $config.@LoadPlugin[$i].library )"; do {
case "$value" in
'olsrd_nameservice'*)
file="$( uci -q get $config.@LoadPlugin[$i].hosts_file )"
break
;;
esac
i=$(( i + 1 ))
} done
echo "${file:-/var/run/hosts_olsr}"
}
read_hostnames()
{
local file_list=" $( hostsfile_getname 'olsrd' ) $(hostsfile_getname 'olsrd6' ) "
local line ip hostname file file_list_uniq
for file in $file_list; do {
case " $file_list_uniq " in
*" $file "*)
;;
*)
file_list_uniq="$file_list_uniq $file"
;;
esac
} done
for file in $file_list_uniq; do {
[ -e "$file" ] || continue
while read -r line; do {
case "$line" in
[0-9]*)
# 2001:ffff:ffff:ffff::1 SomeNode-core.olsr # myself
# 10.0.0.1 SomeNode # 10.0.0.1
set -f
set +f -- $line
ip="$1"
hostname="$2"
# global vars, e.g.
# IP_1_2_3_4='foo' or IP_2001_ffff_ffff_ffff__1='bar'
eval IP_${ip//[.:]/_}="$hostname"
;;
esac
} done <"$file"
} done
}
read_hostnames
VARS='localIP:Local remoteIP:Remote validityTime:vTime linkQuality:LQ'
VARS="$VARS neighborLinkQuality:NLQ linkCost:Cost remoteHostname:Host"
for HOST in '127.0.0.1' '::1';do
# check for availability of HOST
nc $HOST 9090 >/dev/null 2>&1
if [ $? != 0 ]; then
continue
fi
json_init
json_load "$( echo /links | nc $HOST 9090 | sed -n '/^[}{ ]/p' )" # remove header/non-json
if json_is_a links array;then
json_select links
for v in ${VARS};do
eval _${v%:*}=0
done
for j in 0 1;do
case ${j} in 1)
for v in ${VARS};do
eval printf \"%-\${_${v%:*}}s \" ${v#*:}
done
echo
;;esac
i=1;while json_is_a ${i} object;do
json_select ${i}
json_get_vars $(for v in ${VARS};do echo ${v%:*};done)
case ${j} in 0)
for v in ${VARS};do
eval "test \${_${v%:*}} -lt \${#${v%:*}} && _${v%:*}=\${#${v%:*}}"
done
;;*)
for v in ${VARS};do
eval printf \"%-\${_${v%:*}}s \" \$${v%:*}
eval remoteHostname="\$IP_${remoteIP//[.:]/_}"
done
echo
;;esac
json_select ..
i=$(( i + 1 ))
done
done
fi
echo
done

View file

@ -22,3 +22,8 @@ config LoadPlugin
config Interface config Interface
list interface 'wlan' list interface 'wlan'
config procd procd
option respawn_threshold '3600'
option respawn_timeout '15'
option respawn_retry '0'

View file

@ -1,71 +0,0 @@
#!/bin/sh
olsrd_list_configured_interfaces()
{
local i=0
local interface
while interface="$( uci -q get $OLSRD.@Interface[$i].interface )"; do {
case "$( uci -q get $OLSRD.@Interface[$i].ignore )" in
1|on|true|enabled|yes)
# is disabled
;;
*)
echo "$interface" # e.g. 'lan'
;;
esac
i=$(( i + 1 ))
} done
}
olsrd_interface_already_in_config()
{
# e.g.: 'Interface "eth0.1" "eth0.2" "wlan0"'
if grep -s ^'Interface ' "/var/etc/$OLSRD.conf" | grep -q "\"$DEVICE\""; then
logger -t olsrd_hotplug -p daemon.debug "[OK] already_active: '$INTERFACE' => '$DEVICE'"
return 0
else
logger -t olsrd_hotplug -p daemon.info "[OK] ifup: '$INTERFACE' => '$DEVICE'"
return 1
fi
}
olsrd_interface_needs_adding()
{
local interface
# likely and cheap operation:
olsrd_interface_already_in_config && return 1
for interface in $(olsrd_list_configured_interfaces); do {
[ "$interface" = "$INTERFACE" ] && {
olsrd_interface_already_in_config || return 0
}
} done
logger -t olsrd_hotplug -p daemon.debug "[OK] interface '$INTERFACE' => '$DEVICE' not used for $OLSRD"
return 1
}
case "$ACTION" in
ifup)
# only work after the first normal startup
# also: no need to test, if enabled
OLSRD=olsrd
[ -e "/var/etc/$OLSRD.conf" ] && {
# INTERFACE = e.g. 'wlanadhocRADIO1' or 'cfg144d8f'
# DEVICE = e.g. 'wlan1-1'
olsrd_interface_needs_adding && {
. /etc/rc.common /etc/init.d/$OLSRD restart
}
}
OLSRD=olsrd6
[ -e "/var/etc/$OLSRD.conf" ] && {
olsrd_interface_needs_adding && {
. /etc/rc.common /etc/init.d/$OLSRD restart
}
}
;;
esac

View file

@ -1,11 +1,6 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
# Copyright (C) 2008-2017 OpenWrt.org # Copyright (C) 2008-2017 OpenWrt.org
START=65
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes' OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes'
OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2' OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2'
OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2 ipv6only:bool' OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2 ipv6only:bool'
@ -34,6 +29,54 @@ validate_varname() {
return 0 return 0
} }
olsrd_list_configured_interfaces()
{
local i=0
local interface
while interface="$( uci -q get $OLSRD.@Interface[$i].interface )"; do {
case "$( uci -q get $OLSRD.@Interface[$i].ignore )" in
1|on|true|enabled|yes)
# is disabled
;;
*)
echo "$interface" # e.g. 'lan'
;;
esac
i=$(( i + 1 ))
} done
}
olsrd_interface_already_in_config()
{
# e.g.: 'Interface "eth0.1" "eth0.2" "wlan0"'
if grep -s ^'Interface ' "/var/etc/$OLSRD.conf" | grep -q "\"$DEVICE\""; then
logger -t olsrd_hotplug -p daemon.debug "[OK] already_active: '$INTERFACE' => '$DEVICE'"
return 0
else
logger -t olsrd_hotplug -p daemon.info "[OK] ifup: '$INTERFACE' => '$DEVICE'"
return 1
fi
}
olsrd_interface_needs_adding()
{
local interface
# likely and cheap operation:
olsrd_interface_already_in_config && return 1
for interface in $(olsrd_list_configured_interfaces); do {
[ "$interface" = "$INTERFACE" ] && {
olsrd_interface_already_in_config || return 0
}
} done
logger -t olsrd_hotplug -p daemon.debug "[OK] interface '$INTERFACE' => '$DEVICE' not used for $OLSRD"
return 1
}
validate_olsrd_option() { validate_olsrd_option() {
local str="$1" local str="$1"
[ -z "$str" -o "$str" != "${str%%[! 0-9A-Za-z.%/|:_-]*}" ] && return 1 [ -z "$str" -o "$str" != "${str%%[! 0-9A-Za-z.%/|:_-]*}" ] && return 1
@ -581,6 +624,10 @@ olsrd_write_interface() {
ifnames="$ifnames \"$IFNAME\"" ifnames="$ifnames \"$IFNAME\""
ifsglobal="$ifsglobal $IFNAME" ifsglobal="$ifsglobal $IFNAME"
fi fi
elif [[ "$(ip -details link show dev $interface)" == *"wireguard"* ]]; then
# wireguard interface
ifnames="$ifnames \"$interface\""
ifsglobal="$ifsglobal $interface"
else else
log "$funcname() Warning: Interface '$interface' not found, skipped" log "$funcname() Warning: Interface '$interface' not found, skipped"
fi fi
@ -769,7 +816,8 @@ olsrd_setup_smartgw_rules() {
fi fi
} }
start() { olsrd_generate_config() {
UCI_CONF_NAME="$1"
SYSTEM_HOSTNAME= SYSTEM_HOSTNAME=
SYSTEM_LAT= SYSTEM_LAT=
SYSTEM_LON= SYSTEM_LON=
@ -801,23 +849,4 @@ start() {
fi fi
[ -z "$OLSRD_CONFIG_FILE" ] && return 1 [ -z "$OLSRD_CONFIG_FILE" ] && return 1
SERVICE_PID_FILE="$PID"
if service_check /usr/sbin/olsrd; then
error "there is already an instance of $UCI_CONF_NAME running (pid: '$(cat $PID)'), not starting."
return 1
else
service_start /usr/sbin/olsrd -f "$OLSRD_CONFIG_FILE" -nofork
sleep 1
service_check /usr/sbin/olsrd || {
log "startup-error: check via: '/usr/sbin/olsrd -f \"$OLSRD_CONFIG_FILE\" -nofork'"
}
fi
olsrd_setup_smartgw_rules
}
stop() {
SERVICE_PID_FILE="$PID"
service_stop /usr/sbin/olsrd
} }

View file

@ -4,11 +4,76 @@
. $IPKG_INSTROOT/lib/functions/olsrd.sh . $IPKG_INSTROOT/lib/functions/olsrd.sh
START=65 START=65
USE_PROCD=1
SERVICE_DAEMONIZE=1 BIN=/usr/sbin/olsrd
SERVICE_WRITE_PID=1 OLSRD=olsrd
CONF=/var/etc/$OLSRD.conf
CONF=/var/etc/olsrd.conf
PID=/var/run/olsrd.pid PID=/var/run/olsrd.pid
UCI_CONF_NAME=olsrd wait_for_network()
{
ubus -t 15 wait_for network.interface.$1 2>/dev/null
}
wait_for_wireless()
{
local count=0
ubus -t 15 wait_for network.wireless 2>/dev/null
while [ $count -lt 30 ]; do
if [ "$(ubus call network.wireless status | jsonfilter -e '@[*]["pending"]' | grep true | wc -l)" == "0" ]; then
break
fi
count=$((count+1))
sleep 1
done
}
boot()
{
config_load network
config_foreach wait_for_network interface
wait_for_wireless
rc_procd start_service
}
start_service() {
olsrd_generate_config $OLSRD
procd_open_instance
config_load olsrd
local _respawn_threshold
local _respawn_timeout
local _respawn_retry
config_get _respawn_threshold procd respawn_threshold 3600
config_get _respawn_timeout procd respawn_timeout 15
config_get _respawn_retry procd respawn_retry 0
procd_set_param command "$BIN"
procd_append_param command -f ${CONF}
procd_append_param command -nofork
procd_append_param command -pidfile ${PID}
# restart if olsrd dies
procd_set_param respawn $_respawn_threshold $_respawn_timeout $_respawn_retry
# automatically restart olsrd if generated cfg has changed
procd_set_param file $CONF
procd_set_param pidfile $PID
procd_close_instance
olsrd_setup_smartgw_rules
}
service_triggers() {
# reload if config changed via uci
procd_add_reload_trigger "olsrd"
# restart on ifup interface events
for n in $(olsrd_list_configured_interfaces $OLSRD); do
procd_add_reload_interface_trigger $n /etc/init.d/$OLSRD reload
done
}

View file

@ -9,3 +9,8 @@ config LoadPlugin
config Interface config Interface
list interface 'wlan' list interface 'wlan'
config procd procd
option respawn_threshold '3600'
option respawn_timeout '15'
option respawn_retry '0'

View file

@ -4,11 +4,76 @@
. $IPKG_INSTROOT/lib/functions/olsrd.sh . $IPKG_INSTROOT/lib/functions/olsrd.sh
START=65 START=65
USE_PROCD=1
SERVICE_DAEMONIZE=1 BIN=/usr/sbin/olsrd
SERVICE_WRITE_PID=1 OLSRD=olsrd6
CONF=/var/etc/$OLSRD.conf
CONF=/var/etc/olsrd6.conf
PID=/var/run/olsrd6.pid PID=/var/run/olsrd6.pid
UCI_CONF_NAME=olsrd6 wait_for_network()
{
ubus -t 15 wait_for network.interface.$1 2>/dev/null
}
wait_for_wireless()
{
local count=0
ubus -t 15 wait_for network.wireless 2>/dev/null
while [ $count -lt 30 ]; do
if [ "$(ubus call network.wireless status | jsonfilter -e '@[*]["pending"]' | grep true | wc -l)" == "0" ]; then
break
fi
count=$((count+1))
sleep 1
done
}
boot()
{
config_load network
config_foreach wait_for_network interface
wait_for_wireless
rc_procd start_service
}
start_service() {
olsrd_generate_config $OLSRD
procd_open_instance
config_load olsrd6
local _respawn_threshold
local _respawn_timeout
local _respawn_retry
config_get _respawn_threshold procd _respawn_threshold 3600
config_get _respawn_timeout procd respawn_timeout 15
config_get _respawn_retry procd respawn_retry 0
procd_set_param command "$BIN"
procd_append_param command -f ${CONF}
procd_append_param command -nofork
procd_append_param command -pidfile ${PID}
# restart if olsrd dies
procd_set_param respawn $_respawn_threshold $_respawn_timeout $_respawn_retry
# automatically restart olsrd if generated cfg has changed
procd_set_param file $CONF
procd_set_param pidfile $PID
procd_close_instance
olsrd_setup_smartgw_rules
}
service_triggers() {
# reload if config changed via uci
procd_add_reload_trigger "olsrd6"
# restart on ifup interface events
for n in $(olsrd_list_configured_interfaces $OLSRD); do
procd_add_reload_interface_trigger $n /etc/init.d/$OLSRD reload
done
}

View file

View file

@ -1,11 +0,0 @@
--- a/lib/pud/nmealib/src/info.c
+++ b/lib/pud/nmealib/src/info.c
@@ -172,7 +172,7 @@ bool nmeaTimeParseDate(const char *s, NmeaTime *date) {
void nmeaTimeSet(NmeaTime *utc, uint32_t *present, struct timeval *timeval) {
struct timeval tv;
struct tm tm;
- long usec;
+ time_t usec;
if (!utc) {
return;

View file

@ -1,16 +0,0 @@
--- a/src/cfgparser/local.mk
+++ b/src/cfgparser/local.mk
@@ -74,12 +74,8 @@ $(C)oparse.c: $(C)oparse.y $(C)olsrd_conf.h $(C)Makefile
ifeq ($(VERBOSE),0)
@echo "[BISON] $@"
endif
- $(MAKECMDPREFIX)$(BISON) -d -o "$@-tmp" "$<"
- $(MAKECMDPREFIX)sed -e 's/register //' \
- -e '/^#line/s/$(call quote,$@-tmp)/$(call quote,$@)/' \
- < "$@-tmp" >"$@"
- $(MAKECMDPREFIX)mv "$(subst .c,.h,$@-tmp)" "$(subst .c,.h,$@)"
- $(MAKECMDPREFIX)$(RM) "$@-tmp" "$(subst .c,.h,$@-tmp)"
+ $(MAKECMDPREFIX)$(BISON) -d -o "$@" "$<"
+ $(MAKECMDPREFIX)sed -e 's/register //' "$@" > "$@.o" && mv "$@.o" "$@"
$(C)oparse.o: CFLAGS := $(filter-out -Wunreachable-code,$(CFLAGS))

View file

@ -1,11 +0,0 @@
--- a/lib/pud/src/gpsdclient.c
+++ b/lib/pud/src/gpsdclient.c
@@ -370,7 +370,7 @@ void nmeaInfoFromGpsd(struct gps_data_t
);
gpsdata->set &= ~STATUS_SET; /* always valid */
- if (gpsdata->status == STATUS_NO_FIX) {
+ if (gpsdata->fix.status == STATUS_NO_FIX) {
nmeaInfoClear(info);
nmeaTimeSet(&info->utc, &info->present, NULL);
return;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,38 @@
From fcb30aa4da732d279527feba01cacc7dc996d137 Mon Sep 17 00:00:00 2001
From: Nick Hainke <vincent@systemli.org>
Date: Sun, 16 Jan 2022 00:08:56 +0100
Subject: [PATCH] unix: fix meshing with wireguard/point-to-point interfaces
Wireguard interfaces have no BROADCAST flag. We can also mesh on
point-to-point links. That is why we mesh now also on interfaces with
the IFF_POINTOPOINT flag enabled.
Signed-off-by: Nick Hainke <vincent@systemli.org>
---
src/unix/ifnet.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/src/unix/ifnet.c
+++ b/src/unix/ifnet.c
@@ -184,8 +184,8 @@ chk_if_changed(struct olsr_if *iface)
/* Check broadcast */
if ((olsr_cnf->ip_version == AF_INET) && !iface->cnf->ipv4_multicast.v4.s_addr && /* Skip if fixed bcast */
- (!(ifp->int_flags & IFF_BROADCAST))) {
- OLSR_PRINTF(3, "\tNo broadcast - removing\n");
+ ((!(ifp->int_flags & IFF_BROADCAST) && !(ifp->int_flags & IFF_POINTOPOINT)))) {
+ OLSR_PRINTF(3, "\tNo broadcast or point-to-point - removing\n");
goto remove_interface;
}
@@ -552,8 +552,8 @@ chk_if_up(struct olsr_if *iface, int deb
/* Check broadcast */
if ((olsr_cnf->ip_version == AF_INET) && !iface->cnf->ipv4_multicast.v4.s_addr && /* Skip if fixed bcast */
- (!(ifs.int_flags & IFF_BROADCAST))) {
- OLSR_PRINTF(debuglvl, "\tNo broadcast - skipping\n");
+ (!(ifs.int_flags & IFF_BROADCAST) && !(ifs.int_flags & IFF_POINTOPOINT))) {
+ OLSR_PRINTF(debuglvl, "\tNo broadcast or point-to-point - skipping\n");
return 0;
}

View file

@ -0,0 +1,83 @@
From 4dabd94d598dd893aaaffbd71c315923c8827a14 Mon Sep 17 00:00:00 2001
From: Nick Hainke <vincent@systemli.org>
Date: Wed, 22 Jun 2022 14:08:04 +0200
Subject: [PATCH] olsrd: prevent storm patches
As described in the PR:
Limit the positive sequence number difference which is considered valid,
and prevent network storms.
Source: https://github.com/aredn/aredn_packages/pull/5
Signed-off-by: Nick Hainke <vincent@systemli.org>
---
src/duplicate_set.c | 16 ++++++++--------
src/duplicate_set.h | 5 +++--
2 files changed, 11 insertions(+), 10 deletions(-)
--- a/src/duplicate_set.c
+++ b/src/duplicate_set.c
@@ -70,7 +70,7 @@ void olsr_cleanup_duplicates(union olsr_
entry = (struct dup_entry *)olsrd_avl_find(&duplicate_set, orig);
if (entry != NULL) {
- entry->too_low_counter = DUP_MAX_TOO_LOW - 2;
+ entry->out_of_bounds_counter = DUP_MAX_OUT_OF_BOUNDS - 2;
}
}
@@ -82,7 +82,7 @@ olsr_create_duplicate_entry(void *ip, ui
if (entry != NULL) {
memcpy(&entry->ip, ip, olsr_cnf->ip_version == AF_INET ? sizeof(entry->ip.v4) : sizeof(entry->ip.v6));
entry->seqnr = seqnr;
- entry->too_low_counter = 0;
+ entry->out_of_bounds_counter = 0;
entry->olsrd_avl.key = &entry->ip;
entry->array = 0;
}
@@ -160,12 +160,12 @@ olsr_message_is_duplicate(union olsr_mes
}
diff = olsr_seqno_diff(seqnr, entry->seqnr);
- if (diff < -31) {
- entry->too_low_counter++;
+ if (diff < -31 || diff > DUP_SEQNR_DIFF_HIGH_LIMIT) {
+ entry->out_of_bounds_counter++;
- // client did restart with a lower number ?
- if (entry->too_low_counter > DUP_MAX_TOO_LOW) {
- entry->too_low_counter = 0;
+ // client did restart with a too low or too high number ?
+ if (entry->out_of_bounds_counter > DUP_MAX_OUT_OF_BOUNDS) {
+ entry->out_of_bounds_counter = 0;
entry->seqnr = seqnr;
entry->array = 1;
return false; /* start with a new sequence number, so NO duplicate */
@@ -174,7 +174,7 @@ olsr_message_is_duplicate(union olsr_mes
return true; /* duplicate ! */
}
- entry->too_low_counter = 0;
+ entry->out_of_bounds_counter = 0;
if (diff <= 0) {
uint32_t bitmask = 1u << ((uint32_t) (-diff));
--- a/src/duplicate_set.h
+++ b/src/duplicate_set.h
@@ -54,13 +54,14 @@
#define DUPLICATE_CLEANUP_INTERVAL 15000
#define DUPLICATE_CLEANUP_JITTER 25
#define DUPLICATE_VTIME 120000
-#define DUP_MAX_TOO_LOW 16
+#define DUP_MAX_OUT_OF_BOUNDS 16
+#define DUP_SEQNR_DIFF_HIGH_LIMIT 0x2000
struct dup_entry {
struct olsrd_avl_node olsrd_avl;
union olsr_ip_addr ip;
uint16_t seqnr;
- uint16_t too_low_counter;
+ uint16_t out_of_bounds_counter;
uint32_t array;
uint32_t valid_until;
};

View file

@ -0,0 +1,60 @@
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -59,6 +59,8 @@
#include <assert.h>
#include <time.h>
+#include "ubus.h"
+
#ifdef __MACH__
#include "mach/clock_gettime.h"
#endif
@@ -363,6 +365,8 @@ poll_sockets(void)
}
OLSR_FOR_ALL_SOCKETS_END(entry);
+ hfd = olsrd_ubus_add_read_sock(&ibits, hfd);
+
/* Running select on the FD set */
do {
n = olsr_select(hfd, fdsets & SP_PR_READ ? &ibits : NULL, fdsets & SP_PR_WRITE ? &obits : NULL, NULL, &tvp);
@@ -395,6 +399,7 @@ poll_sockets(void)
}
}
OLSR_FOR_ALL_SOCKETS_END(entry);
+ olsrd_ubus_receive(&ibits);
}
static void
--- a/src/main.c
+++ b/src/main.c
@@ -74,6 +74,8 @@
#include "lock_file.h"
#include "cli.h"
+#include "ubus.h"
+
#if defined(__GLIBC__) && defined(__linux__) && !defined(__ANDROID__) && !defined(__UCLIBC__)
#define OLSR_HAVE_EXECINFO_H
#endif
@@ -771,6 +773,9 @@ int main(int argc, char *argv[]) {
signal(SIGUSR2, SIG_IGN);
#endif /* _WIN32 */
+ /* Adding ubus */
+ olsrd_add_ubus();
+
/* Starting scheduler */
olsr_scheduler();
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -252,7 +252,7 @@ else
ifeq ($(OS),win32)
LDFLAGS += -Wl,-export-all-symbols
else
- LDFLAGS += -Wl,-export-dynamic
+ LDFLAGS += -Wl,-export-dynamic,-lubus,-lubox
endif
ifeq ($(NORPATH),0)
LDFLAGS += -Wl,-rpath,$(LIBDIR)

229
olsrd/src/src/ubus.c Normal file
View file

@ -0,0 +1,229 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/select.h>
#include <libubox/blob.h>
#include <libubox/blobmsg.h>
#include <libubus.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include "defs.h"
#include "ifnet.h"
#include "interfaces.h"
#include "link_set.h"
#include "log.h"
#include "olsr.h"
#include "olsr_cfg.h"
#include "ubus.h"
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
// Shared state maintained throughout calls to handle ubus messages.
static struct ubus_context *shared_ctx;
enum { INTERFACE_IFNAME, INTERFACE_LQM, __INTERFACE_MAX };
static const struct blobmsg_policy interface_policy[__INTERFACE_MAX] = {
[INTERFACE_IFNAME] = {"ifname", BLOBMSG_TYPE_STRING},
[INTERFACE_LQM] = {"lqm", BLOBMSG_TYPE_STRING},
};
static int olsrd_ubus_add_interface(struct ubus_context *ctx_local,
struct ubus_object *obj,
struct ubus_request_data *req,
const char *method, struct blob_attr *msg) {
struct blob_attr *tb[__INTERFACE_MAX];
struct blob_buf b = {0};
union olsr_ip_addr addr;
int ret;
char *ifname, *lqm;
blobmsg_parse(interface_policy, __INTERFACE_MAX, tb, blob_data(msg),
blob_len(msg));
if (!tb[INTERFACE_IFNAME])
return UBUS_STATUS_INVALID_ARGUMENT;
ifname = blobmsg_get_string(tb[INTERFACE_IFNAME]);
struct interface_olsr *tmp = if_ifwithname(ifname);
if (tmp != NULL) {
return UBUS_STATUS_PERMISSION_DENIED;
}
struct olsr_if *temp;
for (temp = olsr_cnf->interfaces; temp != NULL; temp = temp->next) {
if (strcmp(temp->name, ifname) == 0)
return UBUS_STATUS_PERMISSION_DENIED;
}
struct olsr_if *tmp_ifs = olsr_create_olsrif(ifname, false);
tmp_ifs->cnf =
olsr_malloc(sizeof(struct if_config_options), "Set default config");
*tmp_ifs->cnf = *olsr_cnf->interface_defaults;
if (tb[INTERFACE_LQM]) { // add interface lqm
lqm = blobmsg_get_string(tb[INTERFACE_LQM]);
memset(&addr, 0, sizeof(addr));
struct olsr_lq_mult *mult = malloc(sizeof(*mult));
if (mult == NULL) {
olsr_syslog(OLSR_LOG_ERR, "Out of memory (LQ multiplier).\n");
return UBUS_STATUS_UNKNOWN_ERROR;
}
double lqm_value = atof(lqm);
mult->addr = addr;
mult->value = (uint32_t)(lqm_value * LINK_LOSS_MULTIPLIER);
tmp_ifs->cnf->lq_mult = mult;
tmp_ifs->cnf->orig_lq_mult_cnt++;
}
blob_buf_init(&b, 0);
blobmsg_add_string(&b, "adding", ifname);
ret = ubus_send_reply(ctx_local, req, b.head);
if (ret)
olsr_syslog(OLSR_LOG_ERR, "Failed to send reply: %s\n", ubus_strerror(ret));
blob_buf_free(&b);
return ret;
}
static int olsrd_ubus_del_interface(struct ubus_context *ctx_local,
struct ubus_object *obj,
struct ubus_request_data *req,
const char *method, struct blob_attr *msg) {
struct blob_attr *tb[__INTERFACE_MAX];
struct blob_buf b = {0};
int ret;
char *ifname;
struct olsr_if *tmp_if, *del_if;
blobmsg_parse(interface_policy, __INTERFACE_MAX, tb, blob_data(msg),
blob_len(msg));
if (!tb[INTERFACE_IFNAME])
return UBUS_STATUS_INVALID_ARGUMENT;
ifname = blobmsg_get_string(tb[INTERFACE_IFNAME]);
struct interface_olsr *tmp = if_ifwithname(ifname);
if (tmp != NULL) {
struct olsr_if *temp = olsr_cnf->interfaces, *prev;
if (temp != NULL && (strcmp(temp->name, ifname) == 0)) {
olsr_cnf->interfaces = temp->next;
olsr_remove_interface(temp);
goto send_reply;
}
while (temp != NULL && (strcmp(temp->name, ifname) != 0)) {
prev = temp;
temp = temp->next;
}
if (temp == NULL) {
goto send_reply;
}
prev->next = temp->next;
olsr_remove_interface(temp);
} else {
return UBUS_STATUS_PERMISSION_DENIED;
}
send_reply:
blob_buf_init(&b, 0);
blobmsg_add_string(&b, "deleting", ifname);
ret = ubus_send_reply(ctx_local, req, b.head);
if (ret)
olsr_syslog(OLSR_LOG_ERR, "Failed to send reply: %s\n", ubus_strerror(ret));
blob_buf_free(&b);
return ret;
}
// List of functions we expose via the ubus bus.
static const struct ubus_method olsrd_methods[] = {
UBUS_METHOD("add_interface", olsrd_ubus_add_interface, interface_policy),
UBUS_METHOD("del_interface", olsrd_ubus_del_interface, interface_policy),
};
// Definition of the ubus object type.
static struct ubus_object_type olsrd_object_type =
UBUS_OBJECT_TYPE("olsrd", olsrd_methods);
// Object we announce via the ubus bus.
static struct ubus_object olsrd_object = {
.name = "olsrd",
.type = &olsrd_object_type,
.methods = olsrd_methods,
.n_methods = ARRAY_SIZE(olsrd_methods),
};
// Registers handlers for olsrd methods in the global ubus context.
static bool ubus_init_object() {
int ret;
ret = ubus_add_object(shared_ctx, &olsrd_object);
if (ret) {
olsr_syslog(OLSR_LOG_ERR, "Failed to add object: %s\n", ubus_strerror(ret));
return false;
}
return true;
}
// Initializes the global ubus context, connecting to the bus to be able to
// receive and send messages.
static bool olsrd_ubus_init(void) {
if (shared_ctx)
return true;
shared_ctx = ubus_connect(NULL);
if (!shared_ctx)
return false;
return true;
}
void olsrd_ubus_receive(fd_set *readfds) {
if (!shared_ctx)
return;
if (FD_ISSET(shared_ctx->sock.fd, readfds))
ubus_handle_event(shared_ctx);
}
int olsrd_ubus_add_read_sock(fd_set *readfds, int maxfd) {
if (!shared_ctx)
return maxfd;
FD_SET(shared_ctx->sock.fd, readfds);
return MAX(maxfd, shared_ctx->sock.fd + 1);
}
bool olsrd_add_ubus() {
if (!olsrd_ubus_init()) {
olsr_syslog(OLSR_LOG_ERR, "Failed to initialize ubus!\n");
return false;
}
if (!ubus_init_object()) {
olsr_syslog(OLSR_LOG_ERR, "Failed to add objects to ubus!\n");
return false;
}
return true;
}

40
olsrd/src/src/ubus.h Normal file
View file

@ -0,0 +1,40 @@
/*
IPC integration of olsrd with OpenWrt.
The ubus interface offers following functions:
- add_inteface '{"ifname":"wg_51820", "lqm": "0.5"}'
- del_inteface '{"ifname":"wg_51820"}'
*/
#include <stdbool.h>
#include <sys/select.h>
/**
* Initialize ubus interface.
*
* Connect to the ubus daemon and expose the ubus functions.
*
* @return if initializing ubus was successful
*/
bool olsrd_add_ubus();
/**
* Add ubus socket to given filedescriptor set.
*
* We need to check repeatedly if the ubus socket has something to read.
* The functions allows to add the ubus socket to the normal while(1)-loop of
* olsrd.
*
* @param readfs: the filedescriptor set
* @param maxfd: the current maximum file descriptor
* @return the maximum file descriptor
*/
int olsrd_ubus_add_read_sock(fd_set *readfds, int maxfd);
/**
* Check and process ubus socket.
*
* If the ubus-socket signals that data is available, the ubus_handle_event is
* called.
*/
void olsrd_ubus_receive(fd_set *readfds);

View file

@ -10,24 +10,25 @@ PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_MIRROR_HASH:=a5413418b7ab1665758f883a652ff589de6a78ccf9201d29bc13f372cb9adeb0
CMAKE_INSTALL:=1 CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk include $(INCLUDE_DIR)/cmake.mk
CMAKE_OPTIONS=-D OONF_NO_WERROR:Bool=true \ CMAKE_OPTIONS+=-D OONF_NO_WERROR:Bool=true \
-D OONF_LOGGING_LEVEL:String=debug \ -D OONF_LOGGING_LEVEL:String=debug \
-D OONF_NO_TESTING:Bool=true \ -D OONF_NO_TESTING:Bool=true \
-D UCI:Bool=true \ -D UCI:Bool=true \
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \ -D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
-D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_proxy" \ -D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_proxy" \
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \ -D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
-D OONF_VERSION:String=$(PKG_VERSION) \ -D OONF_VERSION:String=$(PKG_VERSION) \
-D INSTALL_LIB_DIR:Path=lib/oonf \ -D INSTALL_LIB_DIR:Path=lib/oonf \
-D INSTALL_INCLUDE_DIR:Path=include/oonf \ -D INSTALL_INCLUDE_DIR:Path=include/oonf \
-D INSTALL_CMAKE_DIR:Path=lib/oonf \ -D INSTALL_CMAKE_DIR:Path=lib/oonf \
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr -D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
define Package/oonf-git/template define Package/oonf-git/template
SECTION:=net SECTION:=net

View file

@ -1,47 +1,42 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=oonf-dlep-radio PKG_NAME:=oonf-dlep-radio
PKG_VERSION:=v0.15.1 PKG_VERSION:=0.15.1
PKG_REV:=bffb88b040659b237c4c91b6b42dbbb47431750e PKG_RELEASE:=$(AUTORELEASE)
PKG_RELEASE:=$(PKG_REV)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_DATE:=2018-03-19
PKG_SOURCE_VERSION:=bffb88b040659b237c4c91b6b42dbbb47431750e
PKG_MIRROR_HASH:=c85bf1e38483979f44486b6ad90800535fc7039a162c536c239d897b7c68ef70
PKG_MAINTAINER:=Henning Rogge <hrogge@gmail.com>
CMAKE_INSTALL:=1 CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk include $(INCLUDE_DIR)/cmake.mk
CMAKE_OPTIONS=-D OONF_NO_WERROR:Bool=true \ CMAKE_OPTIONS+=-D OONF_NO_WERROR:Bool=true \
-D OONF_LOGGING_LEVEL:String=debug \ -D OONF_LOGGING_LEVEL:String=debug \
-D OONF_NO_TESTING:Bool=true \ -D OONF_NO_TESTING:Bool=true \
-D UCI:Bool=true \ -D UCI:Bool=true \
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \ -D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
-D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_radio" \ -D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_radio" \
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \ -D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
-D OONF_VERSION:String=$(PKG_VERSION) \ -D OONF_VERSION:String=$(PKG_VERSION) \
-D INSTALL_LIB_DIR:Path=lib/oonf \ -D INSTALL_LIB_DIR:Path=lib/oonf \
-D INSTALL_INCLUDE_DIR:Path=include/oonf \ -D INSTALL_INCLUDE_DIR:Path=include/oonf \
-D INSTALL_CMAKE_DIR:Path=lib/oonf \ -D INSTALL_CMAKE_DIR:Path=lib/oonf \
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr -D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
define Package/oonf-git/template
SECTION:=net
CATEGORY:=Network
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
SUBMENU:=OLSR.org network framework
URL:=http://www.olsr.org/
endef
define Package/oonf-dlep-radio define Package/oonf-dlep-radio
$(call Package/oonf-git/template) SECTION:=net
TITLE:= Build DLEP Radio Agent CATEGORY:=Network
DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts SUBMENU:=OLSR.org network framework
VERSION:=$(PKG_VERSION) URL:=http://www.olsr.org/
TITLE:=Build DLEP Radio Agent
DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts
endef endef
Build/Compile=$(call Build/Compile/Default,dlep_radio_static) Build/Compile=$(call Build/Compile/Default,dlep_radio_static)

View file

@ -10,6 +10,7 @@ PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_MIRROR_HASH:=2e38140e804e7fc0138d0893416c4f19b1ca43bd9de066e8b028bd0d59ac9255
CMAKE_INSTALL:=1 CMAKE_INSTALL:=1
@ -30,19 +31,19 @@ CMAKE_OPTIONAL_PLUGINS:= $(subst $(SPACE),;,$(strip \
BUILD_TYPE:= $(if $(filter y,$(CONFIG_DEBUG)),Debug,Release) BUILD_TYPE:= $(if $(filter y,$(CONFIG_DEBUG)),Debug,Release)
CMAKE_OPTIONS=-D CMAKE_BUILD_TYPE:String=$(BUILD_TYPE) \ CMAKE_OPTIONS+=-D CMAKE_BUILD_TYPE:String=$(BUILD_TYPE) \
-D OONF_NO_WERROR:Bool=true \ -D OONF_NO_WERROR:Bool=true \
-D OONF_LOGGING_LEVEL:String=debug \ -D OONF_LOGGING_LEVEL:String=debug \
-D OONF_NO_TESTING:Bool=true \ -D OONF_NO_TESTING:Bool=true \
-D UCI:Bool=true \ -D UCI:Bool=true \
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \ -D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
-D OONF_STATIC_PLUGINS:String="class;clock;duplicate_set;layer2;packet_socket;rfc5444;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_routing;os_system;nhdp;olsrv2;ff_dat_metric;neighbor_probing;nl80211_listener;link_config;layer2info;systeminfo;cfg_uciloader;cfg_compact;nhdpinfo;olsrv2info;netjsoninfo;${CMAKE_OPTIONAL_PLUGINS}" \ -D OONF_STATIC_PLUGINS:String="class;clock;duplicate_set;layer2;packet_socket;rfc5444;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_routing;os_system;nhdp;olsrv2;ff_dat_metric;neighbor_probing;nl80211_listener;link_config;layer2info;systeminfo;cfg_uciloader;cfg_compact;nhdpinfo;olsrv2info;netjsoninfo;${CMAKE_OPTIONAL_PLUGINS}" \
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \ -D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
-D OONF_VERSION:String=$(PKG_VERSION) \ -D OONF_VERSION:String=$(PKG_VERSION) \
-D INSTALL_LIB_DIR:Path=lib/oonf \ -D INSTALL_LIB_DIR:Path=lib/oonf \
-D INSTALL_INCLUDE_DIR:Path=include/oonf \ -D INSTALL_INCLUDE_DIR:Path=include/oonf \
-D INSTALL_CMAKE_DIR:Path=lib/oonf \ -D INSTALL_CMAKE_DIR:Path=lib/oonf \
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr -D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
define Package/oonf-git/template define Package/oonf-git/template
SECTION:=net SECTION:=net

View file

@ -1,6 +1,6 @@
--- a/src-plugins/nhdp/nhdp/nhdp.c --- a/src-plugins/nhdp/nhdp/nhdp.c
+++ b/src-plugins/nhdp/nhdp/nhdp.c +++ b/src-plugins/nhdp/nhdp/nhdp.c
@@ -187,9 +187,9 @@ static struct oonf_rfc5444_protocol *_protocol; @@ -187,9 +187,9 @@ static struct oonf_rfc5444_protocol *_pr
static struct netaddr _originator_v4, _originator_v6; static struct netaddr _originator_v4, _originator_v6;
/* logging sources for NHDP subsystem */ /* logging sources for NHDP subsystem */

View file

@ -6,67 +6,72 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=opennds PKG_NAME:=opennds
PKG_FIXUP:=autoreconf PKG_VERSION:=9.8.0
PKG_VERSION:=8.0.0 PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/opennds/opennds/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/opennds/opennds/tar.gz/v$(PKG_VERSION)?
PKG_SOURCE:=opennds-$(PKG_VERSION).tar.gz PKG_HASH:=11f4a48ef62007f56376c32a028f19183452c62eee6fddcb11aafe822e5ff1b4
PKG_HASH:=5cd7f2f415dde36ff26aba246851a4ff972599c56073a3e1737020ada366d987
PKG_BUILD_DIR:=$(BUILD_DIR)/openNDS-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/openNDS-$(PKG_VERSION)
PKG_MAINTAINER:=Rob White <rob@blue-wave.net> PKG_MAINTAINER:=Rob White <rob@blue-wave.net>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0+
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/opennds define Package/opennds
SUBMENU:=Captive Portals SUBMENU:=Captive Portals
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
DEPENDS:=+libpthread +iptables-mod-ipopt +libmicrohttpd-no-ssl DEPENDS:=+kmod-ipt-conntrack +kmod-ipt-nat +libmicrohttpd-no-ssl
TITLE:=Open public network gateway daemon TITLE:=Open public network gateway daemon
URL:=https://github.com/opennds/opennds URL:=https://github.com/opennds/opennds
CONFLICTS:=nodogsplash nodogsplash2 CONFLICTS:=nodogsplash
endef endef
define Package/opennds/description define Package/opennds/description
openNDS is a Captive Portal that offers a simple way to openNDS is a Captive Portal solution that offers an instant way to provide restricted access to the Internet.
provide restricted access to the Internet by showing a splash With little or no configuration, a dynamically generated and adaptive splash page sequence is automatically served.
page to the user before Internet access is granted. Both client driven Captive Portal Detection (CPD) and gateway driven Captive Portal Identification (CPI - RFC 8910 and RFC 8908) are supported.
It also incorporates an API that allows the creation of Internet access is granted by either a click to continue button, or after credential verification as a result of filling in a login form.
sophisticated authentication applications. The package incorporates the FAS API allowing many flexible customisation options.
The creation of sophisticated third party authentication applications is fully supported.
Internet hosted https portals can be implemented with no security errors, to inspire maximum user confidence.
This version requires iptables-legacy.
endef endef
define Package/opennds/install define Package/opennds/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/opennds $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/opennds $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ndsctl $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/ndsctl $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/opennds/htdocs/images $(INSTALL_DIR) $(1)/etc/opennds/htdocs/images
$(INSTALL_DIR) $(1)/etc/config $(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/usr/lib/opennds $(INSTALL_DIR) $(1)/usr/lib/opennds
$(CP) $(PKG_BUILD_DIR)/resources/splash.html $(1)/etc/opennds/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/splash.css $(1)/etc/opennds/htdocs/ $(CP) $(PKG_BUILD_DIR)/resources/splash.css $(1)/etc/opennds/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/status.html $(1)/etc/opennds/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/splash.jpg $(1)/etc/opennds/htdocs/images/ $(CP) $(PKG_BUILD_DIR)/resources/splash.jpg $(1)/etc/opennds/htdocs/images/
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/config/opennds $(1)/etc/config/ $(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/config/opennds $(1)/etc/config/
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/config/opennds $(1)/etc/opennds/config.uci
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/init.d/opennds $(1)/etc/init.d/ $(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/init.d/opennds $(1)/etc/init.d/
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/uci-defaults/40_opennds $(1)/etc/uci-defaults/ $(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/uci-defaults/40_opennds $(1)/etc/uci-defaults/
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/usr/lib/opennds/restart.sh $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/usr/lib/opennds/restart.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/binauth/binauth_log.sh $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/binauth/binauth_log.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/login.sh $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/libopennds.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/theme_click-to-continue-basic.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/theme_click-to-continue-custom-placeholders.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/theme_user-email-login-basic.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/theme_user-email-login-custom-placeholders.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/get_client_interface.sh $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/get_client_interface.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/get_client_token.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/client_params.sh $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/client_params.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/unescape.sh $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/unescape.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/authmon.sh $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/authmon.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/dnsconfig.sh $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/dnsconfig.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/download_resources.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/post-request.php $(1)/usr/lib/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/post-request.php $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/fas-aes/fas-aes.php $(1)/etc/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/fas-aes/fas-aes.php $(1)/etc/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/fas-hid/fas-hid.php $(1)/etc/opennds/ $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/fas-hid/fas-hid.php $(1)/etc/opennds/

View file

@ -3,10 +3,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=pimbd PKG_NAME:=pimbd
PKG_SOURCE_VERSION:=dbf4e5913b06e3160f506df15e6a047a403a5f21 PKG_SOURCE_VERSION:=dbf4e5913b06e3160f506df15e6a047a403a5f21
PKG_VERSION:=2018-06-19-$(PKG_SOURCE_VERSION) PKG_VERSION:=2018-06-19-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/Oryon/pimbd.git PKG_SOURCE_URL:=https://github.com/Oryon/pimbd.git
PKG_MIRROR_HASH:=a08e474d7c210b084a28afe8f85e1b356a067b2f9ec643d26402680782933ae7
PKG_MAINTAINER:=Pierre Pfister <pierre.pfister@darou.fr> PKG_MAINTAINER:=Pierre Pfister <pierre.pfister@darou.fr>
PKG_LICENSE:=Apache-2.0 PKG_LICENSE:=Apache-2.0