From 8e87fee1d88db2035b741e881f70cfde2fcbf2e6 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 12:14:38 +0200 Subject: [PATCH 1/9] olsrd: set plugin SONAME to the installed filename The plugins are linked with SONAME lib$(PLUGIN_NAME).so, but they are installed as $(PLUGIN_NAME).so.$(PLUGIN_VER) without any symlink named after the SONAME. The CI runtime tests verify that a library with a SONAME has a matching symlink and therefore fail for every olsrd-mod-* package: olsrd-mod-arprefresh: [fail] Library /usr/lib/olsrd_arprefresh.so.0.1 has SONAME 'libolsrd_arprefresh.so' but no corresponding symlink was found in /usr/lib Add a patch which sets the SONAME to the full installed filename. The plugins are dlopen()ed by path and never linked against, so this has no functional effect on olsrd itself. The patch has been submitted upstream. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/Makefile | 2 +- ...gin-SONAME-to-the-installed-filename.patch | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 olsrd/patches/103-make-set-plugin-SONAME-to-the-installed-filename.patch diff --git a/olsrd/Makefile b/olsrd/Makefile index 09a1abd0c..fa7493377 100644 --- a/olsrd/Makefile +++ b/olsrd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=olsrd PKG_SOURCE_DATE:=2024-06-09 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/OLSR/olsrd.git diff --git a/olsrd/patches/103-make-set-plugin-SONAME-to-the-installed-filename.patch b/olsrd/patches/103-make-set-plugin-SONAME-to-the-installed-filename.patch new file mode 100644 index 000000000..1ad1127af --- /dev/null +++ b/olsrd/patches/103-make-set-plugin-SONAME-to-the-installed-filename.patch @@ -0,0 +1,35 @@ +From 11bf26faef5ee6d62a4641407a2f96a97b59db07 Mon Sep 17 00:00:00 2001 +From: Josef Schlehofer +Date: Thu, 6 Aug 2026 09:56:10 +0200 +Subject: [PATCH] make: set plugin SONAME to the installed filename + +The plugins are linked with SONAME lib$(PLUGIN_NAME).so, but they are +installed as $(PLUGIN_NAME).so.$(PLUGIN_VER) and loaded via dlopen() +using that filename. A library whose SONAME does not match any +installed filename confuses tooling which verifies that a symlink +named after the SONAME exists, for example the OpenWrt CI runtime +tests: + + Library /usr/lib/olsrd_arprefresh.so.0.1 has SONAME + 'libolsrd_arprefresh.so' but no corresponding symlink was found + +Use the full installed filename as SONAME instead. This has no +functional effect on olsrd itself, since the plugins are dlopen()ed +by path and never linked against. + +Signed-off-by: Josef Schlehofer +--- + make/Makefile.linux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/make/Makefile.linux ++++ b/make/Makefile.linux +@@ -73,7 +73,7 @@ LIBS += -lrt + # CPPFLAGS += -Dlinux -DLINUX_NETLINK_ROUTING -DLINUX_NL80211 + # LIBS += -lnl + +-PLUGIN_SONAME ?= lib$(PLUGIN_NAME).so ++PLUGIN_SONAME ?= $(PLUGIN_FULLNAME) + PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) + INSTALL_LIB = install -D -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \ + $(LDCONFIG) -n $(LIBDIR) From eb1fe2c459fad8a262293d5164b03217e0fc2bb1 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 09:42:08 +0200 Subject: [PATCH 2/9] olsrd: add test-version.sh for CI runtime tests The package version is derived from PKG_SOURCE_DATE and the git hash (e.g. 2024.06.09~d72be9ad), which no executable installed by the olsrd packages reports, so the generic version check of the CI runtime tests always fails: olsrd: No executables in the package provided version 2024.06.09~d72be9ad Override the generic version check: verify that the olsrd binary starts and prints its version banner, and skip the check for the plugin and utility packages, which do not provide any version information. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/test-version.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 olsrd/test-version.sh diff --git a/olsrd/test-version.sh b/olsrd/test-version.sh new file mode 100644 index 000000000..06024ba79 --- /dev/null +++ b/olsrd/test-version.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# shellcheck shell=busybox + +case "$PKG_NAME" in +olsrd) + # The version of olsrd is derived from the source date and git + # hash, which the binary does not report. Check that the binary + # starts and prints its version banner instead. + olsrd -v 2>&1 | grep -F "olsr.org" + ;; + +olsrd-mod-*) + # Plugins are libraries and do not provide version information + exit 0 + ;; + +olsrd-utils) + # Shell scripts only, no version information provided + exit 0 + ;; + +*) + echo "Untested package: $PKG_NAME" >&2 + exit 1 + ;; +esac From e18ac80ea78cdd967614bd7f393a9acf38dabb0e Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 09:43:10 +0200 Subject: [PATCH 3/9] olsrd: clean up Makefile - Remove the MAINTAINER override from the shared package template. It shadowed PKG_MAINTAINER for every olsrd package and listed a different person than the intended maintainer. - Add PKG_LICENSE_FILES pointing to license.txt shipped in the source tree. - Use HTTPS for the project homepage URL. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/olsrd/Makefile b/olsrd/Makefile index fa7493377..e33cadf54 100644 --- a/olsrd/Makefile +++ b/olsrd/Makefile @@ -17,6 +17,7 @@ PKG_MIRROR_HASH:=e05d2724e6c76233148ce460b9611bafccff2114904542fa3b5caf75dc1c4e0 PKG_MAINTAINER:=Nick Hainke PKG_BUILD_PARALLEL:=0 PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=license.txt include $(INCLUDE_DIR)/package.mk @@ -26,9 +27,8 @@ define Package/olsrd/template SECTION:=net CATEGORY:=Network SUBMENU:=Routing and Redirection - MAINTAINER:=Saverio Proto TITLE:=OLSR (Optimized Link State Routing) daemon - URL:=http://www.olsr.org/ + URL:=https://www.olsr.org/ endef define Package/olsrd From 6c1c168e187d078bf271a82b9ea57ad8f9fc1706 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 13:55:21 +0200 Subject: [PATCH 4/9] olsrd: report the packaged version in the binary olsrd builds its version banner from the VERS make variable, which defaults to the upstream development version "pre-0.9.9", so `olsrd -v` never mentioned the version the package was built from: olsr.org - pre-0.9.9-git_0000000-hash_5fd8976... The source tarball carries no git metadata either, so the git hash in that string is always zero. Pass PKG_VERSION as VERS, the same way alfred and batctl already pass REVISION, so the banner identifies the packaged revision: olsr.org - 2024.06.09~d72be9ad-git_0000000-hash_5fd8976... This also lets test-version.sh check the real version instead of merely confirming that the binary starts. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/Makefile | 1 + olsrd/test-version.sh | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/olsrd/Makefile b/olsrd/Makefile index e33cadf54..71d9638bc 100644 --- a/olsrd/Makefile +++ b/olsrd/Makefile @@ -177,6 +177,7 @@ endef MAKE_FLAGS+= \ NO_DEBUG_MESSAGES=1 \ + VERS="$(PKG_VERSION)" \ OS="linux" \ DESTDIR="$(PKG_INSTALL_DIR)" \ STRIP="true" \ diff --git a/olsrd/test-version.sh b/olsrd/test-version.sh index 06024ba79..629a61966 100644 --- a/olsrd/test-version.sh +++ b/olsrd/test-version.sh @@ -4,10 +4,7 @@ case "$PKG_NAME" in olsrd) - # The version of olsrd is derived from the source date and git - # hash, which the binary does not report. Check that the binary - # starts and prints its version banner instead. - olsrd -v 2>&1 | grep -F "olsr.org" + olsrd -v 2>&1 | grep -F "$PKG_VERSION" ;; olsrd-mod-*) From 6855753802f90797b5375d9ba7c2ab6f59efe398 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 14:30:30 +0200 Subject: [PATCH 5/9] olsrd: fix respawn_threshold lookup in the IPv6 init script The UCI option is spelled respawn_threshold, as documented in files/olsrd6.config and as read by files/olsrd4.init, but the IPv6 init script looks up _respawn_threshold. The lookup never matches, so a user-configured value is silently ignored and the built-in default of 3600 is always used. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/files/olsrd6.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/olsrd/files/olsrd6.init b/olsrd/files/olsrd6.init index a20e96728..1b4560f5e 100644 --- a/olsrd/files/olsrd6.init +++ b/olsrd/files/olsrd6.init @@ -46,7 +46,7 @@ start_service() { local _respawn_timeout local _respawn_retry - config_get _respawn_threshold procd _respawn_threshold 3600 + config_get _respawn_threshold procd respawn_threshold 3600 config_get _respawn_timeout procd respawn_timeout 15 config_get _respawn_retry procd respawn_retry 0 From e731b57c58bf98e0eb1acffc357225e8649e5641 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 14:30:30 +0200 Subject: [PATCH 6/9] olsrd: add missing jshn dependency to olsrd-utils The only file shipped by olsrd-utils is olsrd-neigh.sh, which sources /usr/share/libubox/jshn.sh on its third line. That file belongs to the jshn package, which is not pulled in by the olsrd -> libubus -> libubox dependency chain, so on a minimal image the utility fails immediately with "not found". Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/olsrd/Makefile b/olsrd/Makefile index 71d9638bc..aad7f81a2 100644 --- a/olsrd/Makefile +++ b/olsrd/Makefile @@ -159,7 +159,7 @@ endef define Package/olsrd-utils $(call Package/olsrd/template) - DEPENDS:=olsrd + DEPENDS:=olsrd +jshn TITLE:=Utils for OLSRD endef From c24d19d93e8d7ffa836e889f33837bcf09497176 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 14:30:30 +0200 Subject: [PATCH 7/9] olsrd: initialize the LQ multiplier list pointer in the ubus handler The ubus add_interface handler allocates a struct olsr_lq_mult with malloc() and assigns only ->addr and ->value, leaving ->next uninitialized before the node is published into cnf->lq_mult. olsrd walks that list with for (mult = cnf->lq_mult; mult != NULL; mult = mult->next) so the first traversal follows an indeterminate pointer. Chain the new node onto the existing list, which is what the configuration file parser does for LinkQualityMult in src/cfgparser/oparse.y. This also makes the orig_lq_mult_cnt++ on the next line consistent, since the entry really is prepended to the list instead of replacing it. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/src/src/ubus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/olsrd/src/src/ubus.c b/olsrd/src/src/ubus.c index 37c2dbf99..88caed13c 100644 --- a/olsrd/src/src/ubus.c +++ b/olsrd/src/src/ubus.c @@ -83,6 +83,7 @@ static int olsrd_ubus_add_interface(struct ubus_context *ctx_local, double lqm_value = atof(lqm); mult->addr = addr; mult->value = (uint32_t)(lqm_value * LINK_LOSS_MULTIPLIER); + mult->next = tmp_ifs->cnf->lq_mult; tmp_ifs->cnf->lq_mult = mult; tmp_ifs->cnf->orig_lq_mult_cnt++; } From f290d5777ec50941c320154daf5b420c047eb0dc Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 14:30:30 +0200 Subject: [PATCH 8/9] olsrd: reject non-address input before eval in olsrd-neigh.sh olsrd-neigh.sh builds shell variable names from data announced by other nodes in the mesh and passes them through eval: eval IP_${ip//[.:]/_}="$hostname" eval re-parses the string after the quotes have been consumed by the first expansion pass, so a hostname of `x;reboot` announced by a remote node is executed as a command on every node that runs the utility. The values come from the nameservice plugin's hosts file and from the txtinfo plugin, both of which carry unauthenticated remote input. Discard entries containing anything other than the characters that can legitimately appear in an address or hostname before they reach eval, in both places. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/files/olsrd-neigh.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/olsrd/files/olsrd-neigh.sh b/olsrd/files/olsrd-neigh.sh index 65a32a6b4..bf78f51a5 100755 --- a/olsrd/files/olsrd-neigh.sh +++ b/olsrd/files/olsrd-neigh.sh @@ -50,6 +50,11 @@ read_hostnames() ip="$1" hostname="$2" + # both values are announced by other nodes in the + # mesh, so reject anything that is not a plain + # address/hostname before it reaches eval + case "$ip$hostname" in *[!A-Za-z0-9.:_-]*) continue ;; esac + # global vars, e.g. # IP_1_2_3_4='foo' or IP_2001_ffff_ffff_ffff__1='bar' eval IP_${ip//[.:]/_}="$hostname" @@ -89,6 +94,12 @@ for HOST in '127.0.0.1' '::1';do i=1;while json_is_a ${i} object;do json_select ${i} json_get_vars $(for v in ${VARS};do echo ${v%:*};done) + + # remoteIP is announced by other nodes in the mesh and + # is interpolated into a variable name below, so reject + # anything that is not a plain address + case "$remoteIP" in *[!A-Za-z0-9.:_-]*) remoteIP= ;; esac + case ${j} in 0) for v in ${VARS};do eval "test \${_${v%:*}} -lt \${#${v%:*}} && _${v%:*}=\${#${v%:*}}" From 8577e20f0a6ad4584484806978eefdc758b93b47 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Mon, 10 Aug 2026 09:56:49 +0200 Subject: [PATCH 9/9] olsrd: record why the version check logs "Terminated" olsrd leaves through olsr_exit(), which ends the process with raise(SIGTERM) rather than returning from main, so the shell reports "Terminated" right after the version banner even for a plain `olsrd -v`. The pipeline status comes from grep, so the check itself is unaffected, but the line in the CI log looks like a failure to anyone reading it. Note it in the script so the next reader does not go hunting. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- olsrd/test-version.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/olsrd/test-version.sh b/olsrd/test-version.sh index 629a61966..581b49176 100644 --- a/olsrd/test-version.sh +++ b/olsrd/test-version.sh @@ -4,6 +4,10 @@ case "$PKG_NAME" in olsrd) + # olsrd leaves through olsr_exit(), which ends the process with + # raise(SIGTERM) even for -v, so the shell reports "Terminated" + # after the banner. The pipeline status comes from grep, so the + # check is unaffected. olsrd -v 2>&1 | grep -F "$PKG_VERSION" ;;