The preprocessor macros defined in some header can be checked, using
Autoconf's AC_COMPILE_IFELSE, or with simpler AC_CHECK_DECL(S), or even
better and simpler directly in the C code.
Instead of the project macro, the sockaddr_storage and sockaddr.sa_len
can be checked with the AC_CHECK_TYPES and AC_CHECK_MEMBERS by including
the sys/socket.h. Some systems (~1988) didn't include the sys/types.h in
the socket.h (obsolete on current systems).
These macros by default define the HAVE_STRUCT_SOCKADDR_STORAGE and
HAVE_STRUCT_SOCKADDR_SA_LEN.
bug#75721 patch from jonathan@tangential.ca.
MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP socket option for the RFC 3678
support does not work on freebsd, using IP_ADD_MEMBERSHIP instead.
This syncs the installed sapi and extension headers on *nix and Windows
systems by installing only what is intended outside of php-src.
- ext/gd: without gd_arginfo.h and gd_compat.h
- ext/hash: php_hash_joaat.h and php_hash_fnv.h added also on Windows
installation; xxhash/xxhash.h added on both installations as it is
included in php_hash_xxhash.h; Include path for xxhash.h changed to
relative so the php_hash_xxhash.h can be included outside of php-src;
Redundant include flags removed
- ext/iconv: without iconv_arginfo.h
- ext/mysqli: mysqli_mysqlnd.h was missing on Windows
- ext/phar: php_phar.h was missing on Windows
- ext/sodium: php_libsodium.h was missing on *nix
- ext/xml: without xml_arginfo.h
- sapi/cli: cli.h was missing on Windows
Closes GH-13210
Closes GH-13213
- Unused header checks removed:
HAVE_NETINET_TCP_H and HAVE_SYS_UN_H are not used in the code.
- Duplicate linux/filter.h check removed:
HAVE_LINUX_FILTER_H is already defined in ext/sockets.
starting with the socket extension. PHP 8 requires windows vista/2008
minimum, even more exotic systems like solaris or haiku supports
inet_ntop, so there is no need to keep supporting this old interface.
Close GH-12551
These three tests try to create an ipv6 socket with socket_create() to
determine if they should be skipped. On certain systems lacking ipv6
support, however, the call to socket_create() itself raises a warning:
BORK Warning: socket_create(): Unable to create socket [97]: Address
family not supported by protocol in ...
The output is "borked" because the return value (false) is expected
but the text of the warning is not. This commit uses the error control
operator (@) to hide the warning. Afterwards the tests are skipped
normally on such a system.
This was first pointed out in GH-10959.
The from_zval_... functions don't always write to the pointer, in particular
it is necessary to check for an error before using the value. Otherwise
we can access an uninitialized value and that's UB (and dangerous).
Note: this does *NOT* get rid of the compiler warning. Even though there
is error checking now, the compiler isn't smart enough to figure out
that the values can not be used uninitialized.
Closes GH-10966.
Allow to bind a socket to a divert port without being concerned
by its address. for ipfw filter purpose (SO_USER_COOKIE constant).
FreeBSD only.
Close GH-10415.
having tigher control on ACK delays, difference is the setting
is `volatile` as it can be turned off by the kernel if not set
explicitally set otherwise on the socket.
Closes GH-10145.