net: drop connection on unknown socket family in AcceptConnection #34678

pull chriszeng1010 wants to merge 1 commits into bitcoin:master from chriszeng1010:fix-accept-unknown-sockaddr changing 1 files +2 −2
  1. chriszeng1010 commented at 4:52 am on February 26, 2026: none

    When SetSockAddr() fails in AcceptConnection(), the code logs a warning but continues processing the connection with a default empty CService address. This means ban checks, whitelist matching, and all downstream logic operate on an invalid address.

    Return early on failure instead, consistent with other error paths in the same function.

  2. net: drop connection on unknown socket family in AcceptConnection 882ed5f78e
  3. DrahtBot added the label P2P on Feb 26, 2026
  4. DrahtBot commented at 4:52 am on February 26, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK Bortlesboat

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. DrahtBot added the label CI failed on Feb 28, 2026
  6. DrahtBot removed the label CI failed on Mar 2, 2026
  7. Bortlesboat commented at 10:42 pm on March 7, 2026: none

    Concept ACK on the AcceptConnection early return — continuing with a default empty CService after SetSockAddr failure means ban checks and whitelist matching run against an invalid address, which is clearly wrong.

    One question: the diff also includes a change to the ConnectNode log line (removing ConnectionTypeAsString(conn_type) from the debug log). The PR description only mentions the AcceptConnection fix. Is the logging change intentional? If so, it might be cleaner as a separate commit since the two changes are unrelated.

  8. chriszeng1010 commented at 3:36 am on March 8, 2026: none

    Concept ACK on the AcceptConnection early return — continuing with a default empty CService after SetSockAddr failure means ban checks and whitelist matching run against an invalid address, which is clearly wrong.

    One question: the diff also includes a change to the ConnectNode log line (removing ConnectionTypeAsString(conn_type) from the debug log). The PR description only mentions the AcceptConnection fix. Is the logging change intentional? If so, it might be cleaner as a separate commit since the two changes are unrelated.

    the only change is in AcceptConnection()


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-09 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me