Skip to content

notifier: report only the devices of the initial namespace - #797

Open
lneto wants to merge 3 commits into
masterfrom
claude_ifquarantine_fixes
Open

notifier: report only the devices of the initial namespace#797
lneto wants to merge 3 commits into
masterfrom
claude_ifquarantine_fixes

Conversation

@lneto

@lneto lneto commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Two defects found while validating the ifquarantine example. notifier.netdevice was given every network namespace while the name it hands the script only resolves in the initial one, so the loopback of a new namespace made the example quarantine the host one; and the example read callback ignored the offset, so cat /dev/ifquarantine, which the README suggests, never reached end of file and filled the disk here.

The netdevice chain registers per namespace, with register_netdevice_notifier_net, and the callback returns the slice the offset asks for. Test: netns_scope, which the global chain fails.

lneto and others added 3 commits September 6, 2026 19:01
register_netdevice_notifier hands the chain every namespace, and the
callback receives a device name, which resolves for the script only in
the initial one: the loopback of a new namespace, registering as "lo",
made ifquarantine quarantine the host's. The netdevice chain registers
with register_netdevice_notifier_net, which 5.15 already has, and
LUANOTIFIER_NEWCHAIN takes the pair of functions, since the per-netns
ones do not follow the register_<name>_notifier spelling.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The read callback ignored the offset and returned the whole listing
every time, so a reader never reached the end of the file: the cat the
README suggests ran until it filled the disk. Return the slice the
offset and the length ask for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant