python / python/cpython

socket.gethostbyaddr does not work with IPv6 on Solaris

Open
#157,497 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

extension-modules OS-unsupported type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

The documentation suggests that socket.gethostbyaddr supports both IPv4 and IPv6:
https://docs.python.org/3/library/socket.html#socket.gethostbyaddr
however, gethostbyaddr_r on Solaris does not support IPv6.

Solaris/Illumos provide platform-specific getipnodebyaddr function which can be used to lookup IPv6 addresses.

I did not test this with Illumos, but the man page suggest the same behavior as with Oracle Solaris:
https://www.smartos.org/man/3nsl/gethostbyaddr_r

"the functions described in the following cannot be used with applications targeted to work with IPv6."

CPython versions tested on:

CPython main branch, 3.13, 3.11

Operating systems tested on:

Other

Linked PRs
  • gh-157498

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the socket.gethostbyaddr entry point and review how CPython calls gethostbyaddr_r on Solaris. Compare that path with the platform-specific getipnodebyaddr behavior described in the issue, and review linked PR gh-157498. Done means IPv6 reverse lookups work on Solaris without breaking existing IPv4 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.