Skip to content

Commit 1d198c6

Browse files
committed
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
1 parent 1108710 commit 1d198c6

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ PHP NEWS
5252
get_defined_functions(). (Girgias)
5353
. The SOAP_FUNCTIONS_ALL constant is now deprecated. (Girgias)
5454

55+
- Sockets:
56+
. Added IP_PORTRANGE* constants for BSD systems to control ephemeral port
57+
ranges. (David Carlier)
58+
5559
- SPL:
5660
. The SplFixedArray::__wakeup() method has been deprecated as it implements
5761
__serialize() and __unserialize() which need to be overwritten instead.

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,10 @@ PHP 8.4 UPGRADE NOTES
904904
. SO_EXCLBIND (Solaris/Illumos only).
905905
. SO_NOSIGPIPE (macOs and FreeBSD).
906906
. SO_LINGER_SEC (macOs only).
907+
. IP_PORTRANGE (FreeBSD/NetBSD/OpenBSD only).
908+
. IP_PORTRANGE_DEFAULT (FreeBSD/NetBSD/OpenBSD only).
909+
. IP_PORTRANGE_HIGH (FreeBSD/NetBSD/OpenBSD only).
910+
. IP_PORTRANGE_LOW (FreeBSD/NetBSD/OpenBSD only).
907911

908912
- Sodium:
909913
. SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES

ext/sockets/sockets.stub.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,29 @@
711711
const IPV6_V6ONLY = UNKNOWN;
712712
#endif
713713

714+
#ifdef IP_PORTRANGE
715+
/**
716+
* @var int
717+
* @cvalue IP_PORTRANGE
718+
*/
719+
const IP_PORTRANGE = UNKNOWN;
720+
/**
721+
* @var int
722+
* @cvalue IP_PORTRANGE_DEFAULT
723+
*/
724+
const IP_PORTRANGE_DEFAULT = UNKNOWN;
725+
/**
726+
* @var int
727+
* @cvalue IP_PORTRANGE_HIGH
728+
*/
729+
const IP_PORTRANGE_HIGH = UNKNOWN;
730+
/**
731+
* @var int
732+
* @cvalue IP_PORTRANGE_LOW
733+
*/
734+
const IP_PORTRANGE_LOW = UNKNOWN;
735+
#endif
736+
714737
#ifdef EPERM
715738
/**
716739
* Operation not permitted

ext/sockets/sockets_arginfo.h

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)