Skip to content

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

Merged
BKPepe merged 3 commits into
openwrt:openwrt-25.12from
BKPepe:fix-inherited-defects
Sep 9, 2026
Merged

batman-adv, batctl, mesh11sd, nodogsplash, opennds: fix defects found while reviewing the move to openwrt/packages#1199
BKPepe merged 3 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 2 times, most recently 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
@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
@openwrt openwrt Bot added the stale label Aug 26, 2026
@openwrt

openwrt Bot commented Aug 26, 2026

Copy link
Copy Markdown

This pull request has been marked stale because it has the "not following guidelines" label and has seen no activity for 14 days.
It will be closed if nothing happens within another 14 days. Updating your commits to fix the reported issues will remove the stale label automatically.

@openwrt

openwrt Bot commented Sep 9, 2026

Copy link
Copy Markdown

This pull request was closed because it had been marked stale for 14 days with no activity.

If you would like to continue working on it, fix the reported issues and ask a maintainer to reopen it — or open a new pull request with the updated changes.

@openwrt openwrt Bot closed this Sep 9, 2026
@BKPepe BKPepe reopened this Sep 9, 2026
@openwrt openwrt Bot removed stale not following guidelines Pull request does not follow formatting guidelines labels Sep 9, 2026
@ecsv

ecsv commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@BKPepe can you please rebase it to resolve the conflicts? In theory, then this PR would only be about:

  • mesh11sd
  • nodogsplash
  • opennds

BKPepe and others added 3 commits September 9, 2026 12:23
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 is on upstream master but not in a release yet, so the patch
can be dropped once the package is bumped past 7.1.0.

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>
@BKPepe
BKPepe force-pushed the fix-inherited-defects branch from 2076ee5 to 9597b13 Compare September 9, 2026 10:23
@BKPepe
BKPepe merged commit 97d1d3c into openwrt:openwrt-25.12 Sep 9, 2026
10 of 14 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants