ext/sockets: adding SO_BINDTOIFINDEX.

similar to SO_BINDTODEVICE but works with interface ids instead.

close GH-15479
This commit is contained in:
David Carlier 2024-08-18 06:19:36 +01:00
parent 80d784610a
commit d713e3619e
No known key found for this signature in database
GPG Key ID: CEF290BB40D2086B
4 changed files with 16 additions and 1 deletions

4
NEWS
View File

@ -24,6 +24,10 @@ PHP NEWS
- Hash:
. Fix GH-15384 (Build fails on Alpine / Musl for amd64). (timwolla)
- Sockets:
. Added SO_BINDTOIFINDEX to bind a socket to an interface index.
(David Carlier)
- Standard:
. php_uname() now throws ValueErrors on invalid inputs. (Girgias)

View File

@ -979,6 +979,7 @@ PHP 8.4 UPGRADE NOTES
. IP_PORTRANGE_LOW (FreeBSD/NetBSD/OpenBSD only).
. SOCK_NONBLOCK.
. SOCK_CLOEXEC.
. SOCK_BINDTOIFINDEX.
- Sodium:
. SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES

View File

@ -295,6 +295,13 @@ const SO_ERROR = UNKNOWN;
*/
const SO_BINDTODEVICE = UNKNOWN;
#endif
#ifdef SO_BINDTOIFINDEX
/**
* @var int
* @cvalue SO_BINDTOIFINDEX
*/
const SO_BINDTOIFINDEX = UNKNOWN;
#endif
#ifdef SO_USER_COOKIE
/**
* @var int

View File

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: dcdacf23e3445748178066972e101cbe0ebd6ad5 */
* Stub hash: 08677a3dd11366b55a1c539475adead74109595e */
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)
@ -425,6 +425,9 @@ static void register_sockets_symbols(int module_number)
#if defined(SO_BINDTODEVICE)
REGISTER_LONG_CONSTANT("SO_BINDTODEVICE", SO_BINDTODEVICE, CONST_PERSISTENT);
#endif
#if defined(SO_BINDTOIFINDEX)
REGISTER_LONG_CONSTANT("SO_BINDTOIFINDEX", SO_BINDTOIFINDEX, CONST_PERSISTENT);
#endif
#if defined(SO_USER_COOKIE)
REGISTER_LONG_CONSTANT("SO_LABEL", SO_LABEL, CONST_PERSISTENT);
#endif