Fix install time error of glb-redirect on ubuntu noble#194
Open
mpenny-github wants to merge 5 commits into
Open
Fix install time error of glb-redirect on ubuntu noble#194mpenny-github wants to merge 5 commits into
mpenny-github wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Ubuntu Noble (kernel 6.8+/newer toolchains) install-time build failures for the glb-redirect-iptables-dkms source-only DKMS package by updating both the kernel module and the userspace xtables plugin, and adding a compile-time build check to catch regressions earlier in CI.
Changes:
- Version-guards
__cookie_v[46]_check()calls to match newer kernel APIs. - Replaces the userspace
_init()entry point with a constructor to avoid linker symbol collisions on newer toolchains. - Adds a compile-check step to the
glb-redirecttest script to build the kernel module and xtables target in CI.
Show a summary per file
| File | Description |
|---|---|
| src/glb-redirect/script/test | Adds a compile-check that builds ipt_GLBREDIRECT.ko and libxt_GLBREDIRECT.so during tests. |
| src/glb-redirect/libxt_GLBREDIRECT.c | Switches from legacy _init to a constructor-based registration function for the xtables target. |
| src/glb-redirect/ipt_GLBREDIRECT.c | Adds kernel-version guards around syncookie __cookie_v4_check/__cookie_v6_check calls. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Low
A fixed LINUX_VERSION_CODE guard is unreliable because distributions backport the removal of the trailing 'cookie' argument (dropped upstream in Linux 6.8) into earlier kernels. Probe net/tcp.h in the Makefile and pass the detected arity to the C code, falling back to a version heuristic only when the header cannot be read.
…ructive The compile-check temporarily strips lines the build image injects into the in-tree kasan/kcsan kernel headers. Previously it edited them in place with sed -i and never restored them, leaving persistent changes on real hosts/Vagrant VMs (e.g. under sudo script/test) that could break other builds. Back the headers up before patching and restore them on any exit (success, failure, or signal) via a trap.
robschn
approved these changes
Jun 26, 2026
Use a defensive parameter expansion and rm -rf -- so restore_headers()
can never fail under set -e ('missing operand') or delete an unintended
path if backup_dir is ever empty/unset.
…found The previous probe piped awk to 'grep -c u32', which yields 0 both when the 2-arg form is present AND when __cookie_v4_check() isn't found at all, wrongly forcing GLB_COOKIE_CHECK_NO_COOKIE_ARG in the latter case. Capture the declaration text instead and only emit a define when it is actually found (using findstring to pick the form); otherwise emit nothing so the C code falls back to its LINUX_VERSION_CODE heuristic as documented.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The glb-redirect-iptables-dkms package failed to build on Ubuntu Noble (kernel 6.8+) because two things in the source are incompatible with newer kernels and toolchains.
Because the package ships as a source-only DKMS deb, these errors only surfaced at install time and were never caught in CI. The fix version-guards the cookie calls and replaces _init() with a constructor function, plus adds a compile check to the test suite.