Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-39169

resolveip: Replace deprecated network functions with modern equivalents

    XMLWordPrintable

Details

    Description

      resolveip: replace inet_aton/inet_addr, gethostbyname, gethostbyaddr, inet_ntoa with inet_pton, getaddrinfo, getnameinfo, inet_ntop.

      These deprecated functions are IPv4-only and some are not thread-safe (gethostbyname, gethostbyaddr, and inet_ntoa use static internal buffers). The modernized code:

      Adds IPv6 support for both forward and reverse lookups
      Uses thread-safe APIs throughout
      Eliminates the #ifdef WIN32 code path split (inet_pton works on both)
      Removes the h_errno dependency (replaced by gai_strerror)
      Uses AF_UNSPEC with getaddrinfo to return both IPv4 and IPv6 results
      Preserves existing output format, exit codes, and special cases (Broadcast, Null-IP-Addr, Old-Bcast)
      Bump version from 2.3 to 2.4 to reflect the API change.

      Update Solaris library search in CMakeLists.txt from inet_aton to getaddrinfo since the old function is no longer referenced.

      Attachments

        Activity

          People

            raghunandan.bhat Raghunandan Bhat
            gkodinov Georgi Kodinov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.