Skip to content

batman-adv, batctl, mesh11sd, nodogsplash, opennds: fix defects found while reviewing the move to openwrt/packages - #1199

Open
BKPepe wants to merge 5 commits into
openwrt:openwrt-25.12from
BKPepe:fix-inherited-defects
Open

batman-adv, batctl, mesh11sd, nodogsplash, opennds: fix defects found while reviewing the move to openwrt/packages#1199
BKPepe wants to merge 5 commits into
openwrt:openwrt-25.12from
BKPepe:fix-inherited-defects

Conversation

@BKPepe

@BKPepe BKPepe commented Aug 6, 2026

Copy link
Copy Markdown
Member

These are defects that surfaced while preparing the move of these packages to openwrt/packages (#184). They are all pre-existing in this feed, so they are worth fixing here rather than only in the migration PRs — those may take a while to land, and some of this affects users today.

One commit per package:

  • batman-adv/etc/config/batman-adv is registered as a conffile although nothing installs it; the shipped migration script deletes that file as its last step. The same script uses continue to skip a section although there is no loop in the function, which only works because ash walks the dynamic call stack into config_foreach.
  • batctlPKG_BUILD_DIR duplicated the default package.mk derives for a package with build variants; the CONFIG_* switches went through a shexport shell variable although listing them on the make command line is equivalent (~2 KB for the largest variant); plus a user-visible typo and inconsistent indentation.
  • mesh11sdmesh11sd -v waits for br-lan through wait_for_interface() before printing anything, for the full interface_timeout (10 s) when the interface is not up. Patch also submitted upstream as Fix - do not wait for interfaces when printing version or help openNDS/mesh11sd#204.
  • nodogsplash — the init script prints two error messages with the wrong variable, and emits gatewayinterface twice, so the raw UCI value can override the device resolved via network_get_device().
  • openndsURL uses a casing that only resolves through GitHub's redirect.

Each package that changes content gets a PKG_RELEASE bump.

Maintainers: @simonwunderlich (batman-adv, batctl), @bluewavenet (mesh11sd, opennds), @mwarning (nodogsplash)

[allow cherry-pick]

Copilot AI lite review requested due to automatic review settings August 6, 2026 12:33

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
BKPepe force-pushed the fix-inherited-defects branch from 8fed34a to 7206d1e Compare August 6, 2026 13:54
@BKPepe

BKPepe commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

@ecsv @simonwunderlich — heads-up on the batman-adv commit in this PR: the problem is not only on the OpenWrt side.

compat-include/linux/slab.h in the batman-adv tarball carries the same guard as src/compat-hacks.h does here:

#if LINUX_VERSION_IS_LESS(7, 0, 0) && \
    !(LINUX_VERSION_IS_GEQ(6, 18, 33) && LINUX_VERSION_IS_LESS(6, 19, 0))

That range only carves out the 6.18.33 stable backport, but kzalloc_obj / kmalloc_obj / kmalloc_objs have landed in 6.12.y as well — 6.12.100 has them — so the definitions collide with include/linux/slab.h. I checked open-mesh-mirror/batman-adv main and the guard is unchanged there, so an out-of-tree build using batman-adv's own Makefile (which adds -I$(PWD)/compat-include/) against such a kernel should hit the same error. The OpenWrt package does not use compat-include/ — it force-includes its own compat-hacks.h instead — which is why the same three macros exist in two places and why this PR fixes the copy here.

CI made it concrete: exactly the four targets on KERNEL_PATCHVER 6.12 failed and the six on 6.18 passed.

compat-hacks.h:52:9: error: "kzalloc_obj" redefined [-Werror]
./include/linux/slab.h:963:9: note: this is the location of the previous definition

This PR switches the guards to #ifndef kzalloc_obj and friends, so the compat code steps aside whenever the kernel provides the helper, without tracking which point release of which stable series picked the backport up. The same change would apply verbatim to compat-include/linux/slab.h — that file already does #include_next <linux/slab.h> at the top, so it needs only the guard swap and not the extra include this PR adds here.

Since the GitHub mirror has issues and pull requests disabled, I take it patches go to b.a.t.m.a.n@lists.open-mesh.org. Would you like me to send the #ifndef form there, or would you rather take it upstream directly?

@ecsv

ecsv commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@ecsv @simonwunderlich — heads-up on the batman-adv commit in this PR: the problem is not only on the OpenWrt side.

compat-include/linux/slab.h in the batman-adv tarball carries the same guard as src/compat-hacks.h does here:

#if LINUX_VERSION_IS_LESS(7, 0, 0) && \
    !(LINUX_VERSION_IS_GEQ(6, 18, 33) && LINUX_VERSION_IS_LESS(6, 19, 0))

[...]

compat-hacks.h:52:9: error: "kzalloc_obj" redefined [-Werror]
./include/linux/slab.h:963:9: note: this is the location of the previous definition

Upstream batman-adv handles it via:

#if LINUX_VERSION_IS_LESS(7, 0, 0) && \
    !(LINUX_VERSION_IS_GEQ(6, 18, 33) && LINUX_VERSION_IS_LESS(6, 19, 0)) && \
    !(LINUX_VERSION_IS_GEQ(6, 12, 97) && LINUX_VERSION_IS_LESS(6, 13, 0))

This PR switches the guards to #ifndef kzalloc_obj and friends, so the compat code steps aside whenever the kernel provides the helper, without tracking which point release of which stable series picked the backport up. The same change would apply verbatim to compat-include/linux/slab.h — that file already does #include_next <linux/slab.h> at the top, so it needs only the guard swap and not the extra include this PR adds here.

Since the GitHub mirror has issues and pull requests disabled

It is just a read-only mirror. It is not officially support and might be completely out-of-date.

Please use https://git.open-mesh.org/batman-adv.git/ as reference

I take it patches go to b.a.t.m.a.n@lists.open-mesh.org.

Yes, see https://www.open-mesh.org/projects/open-mesh/wiki/Contribute#Submitting-patches

Would you like me to send the #ifndef form there, or would you rather take it upstream directly?

No, I would like to keep the way upstream way for now. You cannot assume that it will stay a define.

We can talk about the #ifndefs when you would keep the check to completely disable it for newer kernels

#if LINUX_VERSION_IS_LESS(7, 0, 0)

@ecsv ecsv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the batctl + batman-adv: Looks mostly ok. But I would prefer when you would keep the outer check to completely disable it for kernels >= 7.0 (#if LINUX_VERSION_IS_LESS(7, 0, 0)). Will make it easier to avoid problems when these are no longer defines or to directly see when these compat defines can finally dropped from this file.

@ecsv

ecsv commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

I take it patches go to b.a.t.m.a.n@lists.open-mesh.org.

Yes, see https://www.open-mesh.org/projects/open-mesh/wiki/Contribute#Submitting-patches

Since you did all the rest, I will handle this part

EDIT: https://git.open-mesh.org/batman-adv.git/commit/?id=96a26bababe5e9c9b9f9226e7cdbe60f49f57b71

@BKPepe
BKPepe force-pushed the fix-inherited-defects branch from 7206d1e to 16bacd7 Compare August 6, 2026 18:32
@BKPepe BKPepe closed this Aug 7, 2026
@BKPepe BKPepe reopened this Aug 7, 2026
@BKPepe
BKPepe force-pushed the fix-inherited-defects branch from 16bacd7 to fc02609 Compare August 8, 2026 20:49
BKPepe and others added 5 commits August 11, 2026 13:10
get_current_setup() runs unconditionally before any argument is
parsed, so even `mesh11sd -v` collects the whole runtime environment
first. That includes refresh_bridgemac(), which calls
wait_for_interface() for br-lan; when that interface is not up, the
poll loop runs for the full interface_timeout, ten seconds by
default.

On a running router br-lan is up and the loop exits on its first
iteration, so the delay is invisible. It shows up wherever the
interface is absent or still coming up.

Add a patch which skips the setup pass for the informational
options, which need only $version and $tmpdir. Verified against the
unpatched script that all seven informational invocations (no
argument, -h, --help, help, -v, --version, version) keep their exact
output and exit status while returning immediately.

Upstream took a different route for the same problem and moved the
get_current_setup() call after the version and help handling. That
change sits in the private 7.2.0 beta, so the patch can be dropped
once the package is bumped to that release.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Three problems in the generated configuration:

- The error message for a missing configuration file prints $file,
  which is never set, instead of $val, which holds the path.
- The warning for the unsupported FAS options prints the value of
  the option instead of its name, so the message does not say which
  option is unsupported.
- gatewayinterface is emitted twice: once resolved to a device via
  network_get_device() as "GatewayInterface", and once more by the
  generic option loop with the raw UCI value. When the value names a
  network section rather than a device, the second line overrides
  the resolved device with a name nodogsplash cannot use.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Upstream spells its repository openNDS/openNDS. The Makefile already
depends on that casing, since PKG_BUILD_DIR expects the openNDS-
tarball root; the lowercase URL only resolves through GitHub's
case-insensitive redirect and is the string shown to users in
menuconfig and the package metadata.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…script

/etc/config/batman-adv is registered as a conffile although the
package never installs it: files/ only ships the uci-defaults
migration script and the netifd proto handlers. The migration script
itself removes /etc/config/batman-adv as its last step once the
settings have been moved into /etc/config/network, so the entry is
left over from the layout that predates batadv_hardif.

The same script uses continue to skip a section, but there is no
loop in the function itself. POSIX leaves continue without an
enclosing loop in the current function unspecified; ash walks the
dynamic call stack and lands on the loop inside config_foreach,
which happens to produce the intended behaviour. Use return, which
expresses the intent directly.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
- PKG_BUILD_DIR was set to exactly the value package.mk derives by
  default for a package with build variants, so the override had no
  effect.
- The CONFIG_* switches were assembled into a newline separated
  string and passed to the build through a shell variable via
  shexport. They can simply be listed on the make command line; the
  result is identical, since later assignments override earlier
  ones, exactly as the "n first, then y" order of the old string
  relied on.
- "managment" is user visible in the description of all three
  variants.
- The MAKE_VARS and MAKE_FLAGS continuation lines were indented with
  spaces while every other multi-line list in the file uses a tab.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@BKPepe
BKPepe force-pushed the fix-inherited-defects branch from fc02609 to 2076ee5 Compare August 11, 2026 11:13
@openwrt openwrt Bot added the not following guidelines Pull request does not follow formatting guidelines label Aug 11, 2026
@openwrt

openwrt Bot commented Aug 11, 2026

Copy link
Copy Markdown

Formality Check: Failed

We checked this pull request against the contribution guidelines. Here is what needs your attention:

🛑 CRITICAL ERRORS

Commit 6d105ee:

  • Backports targeting stable branch (openwrt-25.12) must contain the context line: '(cherry picked from commit ...)' (Use [allow cherry-pick] in PR description or comment to override this check)

Commit 4723774:

  • Backports targeting stable branch (openwrt-25.12) must contain the context line: '(cherry picked from commit ...)' (Use [allow cherry-pick] in PR description or comment to override this check)

Commit 9fcef6f:

  • Backports targeting stable branch (openwrt-25.12) must contain the context line: '(cherry picked from commit ...)' (Use [allow cherry-pick] in PR description or comment to override this check)

Commit 44cb79d:

  • Backports targeting stable branch (openwrt-25.12) must contain the context line: '(cherry picked from commit ...)' (Use [allow cherry-pick] in PR description or comment to override this check)

Commit 2076ee5:

  • Backports targeting stable branch (openwrt-25.12) must contain the context line: '(cherry picked from commit ...)' (Use [allow cherry-pick] in PR description or comment to override this check)

Tip

Do not close this pull request to make corrections. Instead, modify your existing commits (e.g. git commit --amend) and update the branch using git push --force-with-lease --force-if-includes. The checks will re-run automatically.


Something broken? Consider reporting an issue.
Running version 5c87cab deployed on 2026-08-07 23:35:13 CEST

@BKPepe
BKPepe changed the base branch from master to openwrt-25.12 August 11, 2026 11:14
@openwrt openwrt Bot added the release/25.12 Pull request targets the stable release branch release/25.12 label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not following guidelines Pull request does not follow formatting guidelines release/25.12 Pull request targets the stable release branch release/25.12

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants