Skip to content

olsrd: fix plugin SONAME, add test-version.sh, clean up Makefile - #1191

Open
BKPepe wants to merge 9 commits into
openwrt:openwrt-25.12from
BKPepe:olsrd-ci-fixes
Open

olsrd: fix plugin SONAME, add test-version.sh, clean up Makefile#1191
BKPepe wants to merge 9 commits into
openwrt:openwrt-25.12from
BKPepe:olsrd-ci-fixes

Conversation

@BKPepe

@BKPepe BKPepe commented Aug 6, 2026

Copy link
Copy Markdown
Member

This fixes the failing CI runtime tests for olsrd, which is part of the fallback test set (bird2 cjdns olsrd) used for every PR that does not change any package, so these failures currently make CI red repo-wide.

  • The plugins are linked with SONAME lib$(PLUGIN_NAME).so but installed as $(PLUGIN_NAME).so.$(PLUGIN_VER) without any matching symlink, so the library check of the CI runtime tests failed for all 18 olsrd-mod-* packages. Add a patch setting the SONAME to the installed filename; the plugins are dlopen()ed by path, so this has no functional effect. The patch will also be submitted upstream.
  • Add test-version.sh: the package version is date+hash based and not reported by any binary, so the generic version check could never pass. Verify the olsrd version banner instead and skip the check for plugin/utility packages.
  • Makefile cleanup: remove the MAINTAINER override in the shared template which shadowed PKG_MAINTAINER for all packages, add PKG_LICENSE_FILES, use HTTPS homepage URL.

Maintainer: @PolynomialDivision

Copilot AI lite review requested due to automatic review settings August 6, 2026 07:54
@openwrt openwrt Bot added the not following guidelines Pull request does not follow formatting guidelines label Aug 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

BKPepe and others added 9 commits August 11, 2026 13:06
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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
- 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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@openwrt openwrt Bot added the not following guidelines Pull request does not follow formatting guidelines label Aug 11, 2026
@BKPepe
BKPepe changed the base branch from master to openwrt-25.12 August 11, 2026 11:13
@openwrt openwrt Bot added the release/25.12 Pull request targets the stable release branch release/25.12 label Aug 11, 2026
@BKPepe

BKPepe commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

[allow cherry-pick]

@openwrt openwrt Bot removed the not following guidelines Pull request does not follow formatting guidelines label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/25.12 Pull request targets the stable release branch release/25.12 security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants