Skip to content

get rid of inet_aton and inet_ntoa #6944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

remicollet
Copy link
Member

@remicollet remicollet commented May 5, 2021

Some distribution may consider inet_aton, inet_ntoa, inet_addr... as deprecated, and their usage discouraged

@remicollet remicollet changed the title get rid of inet_aton when inet_pton available get rid of inet_aton and inet_ntoa May 5, 2021
@remicollet
Copy link
Member Author

Ready for review and for net_ntoa and inet_aton

$ objdump -T sapi/cli/php | grep inet_
0000000000000000      DF *UND*	0000000000000000  GLIBC_2.2.5 inet_ntop
0000000000000000      DF *UND*	0000000000000000  GLIBC_2.2.5 inet_pton
000000000088de50 g    DF .text	0000000000000188  Base        php_inet_ntop

@nikic
Copy link
Member

nikic commented May 6, 2021

I'm also wondering if we should just have HAVE_INET_PTON/HAVE_INET_NTOP a hard build requirement. It's part of POSIX and supported by Linux, macOS and Windows at least. Are there any known systems that don't have it?

Getting rid of that super dubious lock would be nice.

Just in case anybody executes these test in parallel on PHP 7.4.

(cherry picked from commit b4ffe54)

Closes phpGH-6943.
@remicollet remicollet force-pushed the issue-inet-aton branch 3 times, most recently from ad9e1da to 011b0be Compare May 6, 2021 10:04
@remicollet remicollet requested a review from nikic May 6, 2021 10:07
use inet_ntop iand inet_pton where available
standardize buffer size
@remicollet
Copy link
Member Author

I'm also wondering if we should just have HAVE_INET_PTON/HAVE_INET_NTOP a hard build requirement. It's part of POSIX and supported by Linux, macOS and Windows at least. Are there any known systems that don't have it?

Seems to be in glibc since 2.2.5... (so even in old RHEL-5)
But don't know about other non-linux distro (BSD ?)

@remicollet remicollet requested a review from nikic May 6, 2021 10:16
@remicollet
Copy link
Member Author

Merged in f9547f2

@remicollet remicollet closed this May 6, 2021
@remicollet remicollet deleted the issue-inet-aton branch May 6, 2021 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants