epmd: Fix regression introduced in e522e738e - #11409
Conversation
CT Test Results 2 files 12 suites 7m 57s ⏱️ Results for commit e3d12c3. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
There was a problem hiding this comment.
Pull request overview
Fixes an epmd regression where binding an implicitly-added IPv6 (or IPv4) loopback socket could cause epmd to exit on systems where that loopback/protocol stack is unavailable (e.g., IPv6 disabled), even when users explicitly configure an IPv4-only address like ERL_EPMD_ADDRESS=127.0.0.1.
Changes:
- Reworks “nonfatal bind failure” tracking from an index threshold to a per-socket bitmask.
- Marks implicitly-added loopback sockets (v4/v6) as nonfatal so bind failures are logged but do not terminate epmd.
- Updates the bind failure path to consult the nonfatal socket bitmask and continue after closing the failed socket.
Comments suppressed due to low confidence (2)
erts/epmd/src/epmd_srv.c:389
- Use an unsigned shift when building the nonfatal socket bitmask to avoid signed left-shift pitfalls and make the intent explicit.
nonfatal_sockets |= (1 << num_sockets);
erts/epmd/src/epmd_srv.c:513
- Use an unsigned shift when checking the nonfatal socket bitmask to avoid signed left-shift pitfalls and make the intent explicit.
if (!(nonfatal_sockets & (1 << i))) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #11402