Skip to content

ENT-14083: Fix inet_ntop/inet_pton declaration check for MinGW cross-compilation (3.24.x)#6128

Merged
larsewi merged 1 commit into
cfengine:3.24.xfrom
larsewi:inet_ntop-3.24.x
May 14, 2026
Merged

ENT-14083: Fix inet_ntop/inet_pton declaration check for MinGW cross-compilation (3.24.x)#6128
larsewi merged 1 commit into
cfengine:3.24.xfrom
larsewi:inet_ntop-3.24.x

Conversation

@larsewi
Copy link
Copy Markdown
Contributor

@larsewi larsewi commented May 14, 2026

The AC_CHECK_DECLS for inet_ntop and inet_pton only checked
<arpa/inet.h>, which does not exist on MinGW. On MinGW, these
functions are declared in <ws2tcpip.h>. This caused the check to
fail, leaving HAVE_DECL_INET_NTOP=0, which made platform.h
re-declare inet_ntop with socklen_t. With mingw-w64 >= v11 (Ubuntu
24.04), ws2tcpip.h declares inet_ntop with size_t, causing a
conflicting types error.

Include the correct Winsock headers in the check, matching the
pattern already used by the getaddrinfo check above.

Ticket: ENT-13766
Signed-off-by: Lars Erik Wik lars.erik.wik@northern.tech
(cherry picked from commit 294f0f6)

Backported from #6051

The AC_CHECK_DECLS for inet_ntop and inet_pton only checked
<arpa/inet.h>, which does not exist on MinGW. On MinGW, these
functions are declared in <ws2tcpip.h>. This caused the check to
fail, leaving HAVE_DECL_INET_NTOP=0, which made platform.h
re-declare inet_ntop with socklen_t. With mingw-w64 >= v11 (Ubuntu
24.04), ws2tcpip.h declares inet_ntop with size_t, causing a
conflicting types error.

Include the correct Winsock headers in the check, matching the
pattern already used by the getaddrinfo check above.

Ticket: ENT-13766
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 294f0f6)
@larsewi
Copy link
Copy Markdown
Contributor Author

larsewi commented May 14, 2026

Build Status

@larsewi larsewi changed the title ENT-14083: Fix inet_ntop/inet_pton declaration check for MinGW cross-compilation ENT-14083: Fix inet_ntop/inet_pton declaration check for MinGW cross-compilation (3.24.x) May 14, 2026
@larsewi larsewi merged commit 384bc35 into cfengine:3.24.x May 14, 2026
10 checks passed
@larsewi larsewi deleted the inet_ntop-3.24.x branch May 14, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant