1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/sockets: controlling ephemeral port ranges on *BSD.

whether ephemeral ports are onto the privileged low port ranges
     or a range more fit for restricted scenarios.

close GH-15335
This commit is contained in:
David Carlier
2024-08-10 18:54:39 +00:00
parent 1108710892
commit 1d198c660c
4 changed files with 44 additions and 1 deletions

4
NEWS
View File

@@ -52,6 +52,10 @@ PHP NEWS
get_defined_functions(). (Girgias)
. The SOAP_FUNCTIONS_ALL constant is now deprecated. (Girgias)
- Sockets:
. Added IP_PORTRANGE* constants for BSD systems to control ephemeral port
ranges. (David Carlier)
- SPL:
. The SplFixedArray::__wakeup() method has been deprecated as it implements
__serialize() and __unserialize() which need to be overwritten instead.

View File

@@ -904,6 +904,10 @@ PHP 8.4 UPGRADE NOTES
. SO_EXCLBIND (Solaris/Illumos only).
. SO_NOSIGPIPE (macOs and FreeBSD).
. SO_LINGER_SEC (macOs only).
. IP_PORTRANGE (FreeBSD/NetBSD/OpenBSD only).
. IP_PORTRANGE_DEFAULT (FreeBSD/NetBSD/OpenBSD only).
. IP_PORTRANGE_HIGH (FreeBSD/NetBSD/OpenBSD only).
. IP_PORTRANGE_LOW (FreeBSD/NetBSD/OpenBSD only).
- Sodium:
. SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES

View File

@@ -711,6 +711,29 @@ const IPV6_MULTICAST_LOOP = UNKNOWN;
const IPV6_V6ONLY = UNKNOWN;
#endif
#ifdef IP_PORTRANGE
/**
* @var int
* @cvalue IP_PORTRANGE
*/
const IP_PORTRANGE = UNKNOWN;
/**
* @var int
* @cvalue IP_PORTRANGE_DEFAULT
*/
const IP_PORTRANGE_DEFAULT = UNKNOWN;
/**
* @var int
* @cvalue IP_PORTRANGE_HIGH
*/
const IP_PORTRANGE_HIGH = UNKNOWN;
/**
* @var int
* @cvalue IP_PORTRANGE_LOW
*/
const IP_PORTRANGE_LOW = UNKNOWN;
#endif
#ifdef EPERM
/**
* Operation not permitted

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: e43c00bcb6af1c0a20a92162457883e3a33b4a53 */
* Stub hash: 434b5b721d0f89b6113de4331e9044c891b2bb16 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1)
@@ -602,6 +602,18 @@ static void register_sockets_symbols(int module_number)
#if defined(IPV6_V6ONLY)
REGISTER_LONG_CONSTANT("IPV6_V6ONLY", IPV6_V6ONLY, CONST_PERSISTENT);
#endif
#if defined(IP_PORTRANGE)
REGISTER_LONG_CONSTANT("IP_PORTRANGE", IP_PORTRANGE, CONST_PERSISTENT);
#endif
#if defined(IP_PORTRANGE)
REGISTER_LONG_CONSTANT("IP_PORTRANGE_DEFAULT", IP_PORTRANGE_DEFAULT, CONST_PERSISTENT);
#endif
#if defined(IP_PORTRANGE)
REGISTER_LONG_CONSTANT("IP_PORTRANGE_HIGH", IP_PORTRANGE_HIGH, CONST_PERSISTENT);
#endif
#if defined(IP_PORTRANGE)
REGISTER_LONG_CONSTANT("IP_PORTRANGE_LOW", IP_PORTRANGE_LOW, CONST_PERSISTENT);
#endif
#if defined(EPERM)
REGISTER_LONG_CONSTANT("SOCKET_EPERM", EPERM, CONST_PERSISTENT);
#endif