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

resolveip: Replace deprecated network functions with modern equivalents

    XMLWordPrintable

Details

    • Q2/2026 Server Maintenance

    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

            Roel Roel Van de Paar
            gkodinov Georgi Kodinov
            Raghunandan Bhat Raghunandan Bhat
            Roel Van de Paar Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1d
                1d

                Git Integration

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