Skip to content

Pin that a rebind survives repeated interface recreations - #73

Merged
sbogomolov merged 1 commit into
mainfrom
interface/membership-cap-test
Aug 10, 2026
Merged

Pin that a rebind survives repeated interface recreations#73
sbogomolov merged 1 commit into
mainfrom
interface/membership-cap-test

Conversation

@sbogomolov

Copy link
Copy Markdown
Owner

The rebind reopens its multicast-join fd rather than re-joining on the existing
one. The comment justified that partly by a claim I had not measured: that
memberships for a destroyed interface keep counting against the socket's cap.

Measured it. With igmp_max_memberships at its default 20, joining one group on
one kept socket across successive interface recreations succeeds exactly 20 times
and then fails with ENOBUFS — so a destroyed interface's memberships really are
not scrubbed from a surviving socket, and a kept join fd would leave the daemon
permanently unable to join anything after 20 recreations.

That is a stronger reason for the reopen than the duplicate-join refusal, and
nothing pinned it, so this adds the test that does: join a group, then 25
recreate/reidentify/rebind cycles, asserting each rebind succeeds and the socket
still reports its groups joined.

It pins our behaviour rather than the kernel's, deliberately. If a future kernel
starts scrubbing, the test simply passes; if someone decides the reopen looks
wasteful, it fails. Verified it catches that: with the reopen reverted to a
re-join in place it fails at recreation 19 — the initial join plus 19 more being
the cap — with the ENOBUFS in the log.

The comment now cites the measurement and points at the test instead of arguing
the case, which made it shorter.

910 unit tests native (Debug, ASan/UBSan), 899 in docker including 21 root-gated.

A destroyed interface's memberships are not scrubbed from a surviving socket,
so re-joining on a kept fd adds one per recreation and stops working at
igmp_max_memberships -- 20 by default, measured. Reopening the join fd is what
avoids that, and nothing pinned it.

The test joins a group and runs 25 recreate/rebind cycles; with the reopen
removed it fails at the 20th membership with ENOBUFS.
@sbogomolov sbogomolov self-assigned this Aug 10, 2026
@sbogomolov
sbogomolov merged commit 877e589 into main Aug 10, 2026
17 checks passed
@sbogomolov
sbogomolov deleted the interface/membership-cap-test branch August 10, 2026 19:38
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