[php-src] master: ext/sockets: adding solaris/illumos SO_EXCLBIND constant.
| From: | David Carlier | Date: | Tue, 09 Apr 2024 20:41:44 +0000 |
| Subject: | [php-src] master: ext/sockets: adding solaris/illumos SO_EXCLBIND constant. | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-128007@lists.php.net to get a copy of this message | ||
Author: David Carlier (devnexen)
Date: 2024-04-09T21:41:22+01:00
Commit: https://github.com/php/php-src/commit/645af9fb17d1e99cffaccf018d806bdcd12de150
Raw diff: https://github.com/php/php-src/commit/645af9fb17d1e99cffaccf018d806bdcd12de150.diff
ext/sockets: adding solaris/illumos SO_EXCLBIND constant.
when set to "true", neutralises the effect of SO_REUSEADDR/SO_REUSEPORT
making the socket binding exclusive.
Close GH-13912
Changed paths:
M NEWS
M UPGRADING
M ext/sockets/sockets.stub.php
M ext/sockets/sockets_arginfo.h
Diff:
diff --git a/NEWS b/NEWS
index 89d14dea9a0f0..7078dc16693ef 100644
--- a/NEWS
+++ b/NEWS
@@ -195,6 +195,8 @@ PHP NEWS
. Added multicast group support for ipv4 on FreeBSD. (jonathan@tangential.ca)
. Added the TCP_SYNCNT constant for Linux to set number of attempts to send
SYN packets from the client. (David Carlier)
+ . Added the SO_EXCLBIND constant for exclusive socket binding on illumos/solaris.
+ (David Carlier)
- SNMP:
. Removed the deprecated inet_ntoa call support. (David Carlier)
diff --git a/UPGRADING b/UPGRADING
index 3450825a2a584..b8849007d618b 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -570,6 +570,7 @@ PHP 8.4 UPGRADE NOTES
. SOCK_CONN_DGRAM (NetBSD only).
. SOCK_DCCP (NetBSD only).
. TCP_SYNCNT (Linux only).
+ . SO_EXCLBIND (Solaris/Illumos only).
- Sodium:
. SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES
diff --git a/ext/sockets/sockets.stub.php b/ext/sockets/sockets.stub.php
index 08e45eea8b5de..502fff2e0f19e 100644
--- a/ext/sockets/sockets.stub.php
+++ b/ext/sockets/sockets.stub.php
@@ -410,6 +410,13 @@
*/
const SO_BPF_EXTENSIONS = UNKNOWN;
#endif
+#ifdef SO_EXCLBIND
+/**
+ * @var int
+ * @cvalue SO_EXCLBIND
+ */
+const SO_EXCLBIND = UNKNOWN;
+#endif
#ifdef SKF_AD_OFF
/**
* @var int
diff --git a/ext/sockets/sockets_arginfo.h b/ext/sockets/sockets_arginfo.h
index a26bd000af6f0..6697db704c707 100644
--- a/ext/sockets/sockets_arginfo.h
+++ b/ext/sockets/sockets_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: c761db0839535812316a42200f68c7db22639d81 */
+ * Stub hash: 98bd7f47a1aa8d1c2cb40bf768115da2633f56fb */
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)
@@ -478,6 +478,9 @@ static void register_sockets_symbols(int module_number)
#if defined(SO_BPF_EXTENSIONS)
REGISTER_LONG_CONSTANT("SO_BPF_EXTENSIONS", SO_BPF_EXTENSIONS, CONST_PERSISTENT);
#endif
+#if defined(SO_EXCLBIND)
+ REGISTER_LONG_CONSTANT("SO_EXCLBIND", SO_EXCLBIND, CONST_PERSISTENT);
+#endif
#if defined(SKF_AD_OFF)
REGISTER_LONG_CONSTANT("SKF_AD_OFF", SKF_AD_OFF, CONST_PERSISTENT);
#endif