[27.x backport] Try to load kernel modules, without modprobe #49043
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.
- What I did
When running in a container (docker-in-docker), the host may not have required kernel modules loaded.
Try to trigger the module load using an
ioctl()call, thenmodprobeif that doesn't work.This should make IPv6 networks work in GitHub Codespaces / devcontainers:
This is based on the DinD official image's method of loading modules using
ip link show, which was inspired by https://twitter.com/lucabruno/status/902934379835662336- How I did it
ip6_tables.- How to verify it
On a Debian 12.5 host, running dockerd
27.3.1, with systemd ...ip6_tablesnot loaded on the host (the host doesn't need it, because the daemon'sip6tablescommands use a (deprecated) dbus interface to send raw firewall commands.ip6_tablesmodule wasn't loaded.ip6tablesenabled by-default.ioctlmethod:DEBU[2024-12-05T11:30:36.095500049Z] Modules loaded loadErrors="<nil>" loader=ioctl modules=ip6_tablesDEBU[2024-12-05T11:31:59.533424067Z] Modules already loaded modules=ip6_tablesDEBU[2024-12-05T11:31:59.590301221Z] Modules already loaded modules="nf_conntrack,nf_conntrack_netlink"To check error logging, and fallback to modprobe:
Resulted in:
- Description for the changelog