David Carlier
e583890af0
Fix socket_recvfrom overflow on buffer size.
...
when passing PHP_INT_MAX for the $length param we get this (with ubsan)
`ext/sockets/sockets.c:1409:36: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long int'`
close GH-16382
2024-10-12 15:23:03 +01:00
David Carlier
8537aa687e
Fix GH-16267 socket_strerror overflow on argument value.
...
only socket_strerror provides user-supplied value to sockets_strerror
handler.
close GH-16270
2024-10-06 19:25:38 +01:00
David Carlier
e3f0d03452
Fix GH-13603 ext/sockets: properly initialised address info data.
...
Led to random characters visible on socket id on macOs.
Close GH-13606
2024-03-06 11:37:48 +00:00
twosee
90707f33e1
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fix socket_export_stream() with wrong protocol
2023-09-29 18:33:59 +08:00
twosee
b5da98b972
Fix socket_export_stream() with wrong protocol
...
Closes GH-12310.
2023-09-29 18:33:12 +08:00
Ilija Tovilo
838f6bffff
xfail socket zerocopy test on Cirrus + arm
...
Closes GH-11553
2023-06-29 08:48:48 +02:00
Jakub Zelenka
d2b7d67dac
Merge branch 'PHP-8.1' into PHP-8.2
2022-09-30 17:08:55 +01:00
Jakub Zelenka
ee8f2c75e0
Merge branch 'PHP-8.0' into PHP-8.1
2022-09-30 17:08:17 +01:00
Andy Postnikov
c58241a003
Make socket path shorter for ext/sockets/tests/socket_cmsg_{rights|credentials}.phpt
...
When running in CI it fails when path/address is longer 108
2022-09-30 17:07:40 +01:00
David Carlier
067a3022f8
Sockets disable zerocopy test on ppc based arch.
...
Failure reported by alpine maintainers.
Closes #9081 .
2022-07-21 13:36:49 +01:00
David Carlier
dedad408fe
sockets introduces socket_set_option SO_ZEROCOPY and MSG_ZEROCOPY for the socket_send* functions. it avoids copy b/w userland and kernel for both TCP and UDP protocols.
2022-07-10 20:06:52 +01:00
David Carlier
a193427333
Adds TCP_CONGESTION socket option for Linux/FreeBSD.
...
Closes #8824 .
2022-06-30 19:43:09 +01:00
David Carlier
d677cc13ce
Add SO_BPF_EXTENSIONS flag to socket.
...
Returns the supported bpf extensions from the kernel. Linux only.
Closes GH-8713.
2022-06-08 05:14:57 +01:00
David CARLIER
f813520b50
Implements socket ancillary data on FreeBSD. ( #7708 )
...
using LOCAL_CREDS_PERSISTENT/SCM_CREDS2 instead so we also get the send process id.
2022-06-02 14:08:03 +01:00
Christoph M. Becker
57add48777
Revert "Make socket path shorter for ext/sockets/tests/socket_cmsg_{rights|credentials}.phpt"
...
This reverts commit b0c1773686 , since
this causes CI failures, apparently related to ZTS builds.
2022-05-31 11:22:04 +02:00
Andy Postnikov
b0c1773686
Make socket path shorter for ext/sockets/tests/socket_cmsg_{rights|credentials}.phpt
...
When running in CI it fails when path/address is longer 108
Closes GH-8617.
2022-05-31 10:37:35 +02:00
David Carlier
2410e378c1
Add SO_MEMINFO socket option for gathering socket related info
2022-05-20 22:06:53 +01:00
Joe Watkins
0b5d371a9c
Merge branch 'PHP-8.1'
...
* PHP-8.1:
socket cmsg credential test fixes, "backporting" from the FreeBSD PR.
2021-12-21 07:28:19 +01:00
Joe Watkins
938a81cf01
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
socket cmsg credential test fixes, "backporting" from the FreeBSD PR.
2021-12-21 07:28:09 +01:00
David Carlier
80b02275bb
socket cmsg credential test fixes, "backporting" from the FreeBSD PR.
2021-12-21 07:27:59 +01:00
Nikita Popov
d032b85762
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Use ephemeral port in test
2021-10-05 16:01:00 +02:00
Nikita Popov
e91a751e3d
Use ephemeral port in test
2021-10-05 16:00:50 +02:00
Kamil Tekiela
c3dda473cc
Fix 'can not' in test data and in code comments
2021-10-05 09:51:58 +01:00
Nikita Popov
bc19186c7f
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Use ephemeral ports in socket test
2021-09-20 10:20:10 +02:00
Nikita Popov
624848f118
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Use ephemeral ports in socket test
2021-09-20 10:20:03 +02:00
Nikita Popov
07f6c61c8e
Use ephemeral ports in socket test
2021-09-20 10:19:48 +02:00
Nikita Popov
768265cd22
Fix some more CLEAN sections
2021-09-06 17:03:35 +02:00
Nikita Popov
2ab4482d34
Fix some broken or unnecessary CLEAN sections
2021-09-03 10:52:30 +02:00
Nikita Popov
e539cb9ca0
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix port clash in socket tests
2021-08-12 12:02:37 +02:00
Nikita Popov
77c1c42c66
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix port clash in socket tests
2021-08-12 12:02:27 +02:00
Nikita Popov
78cbe56e68
Fix port clash in socket tests
...
Use ephemeral port instead.
2021-08-12 12:02:05 +02:00
Patrick Allaert
ac18dd0dc7
Prefer EXPECT over EXPECTF
2021-06-29 17:13:02 +02:00
Nikita Popov
892421c9a8
Make some zend_test dependencies explicit
...
Rather than checking that specific functions exist.
2021-06-14 15:40:34 +02:00
Nikita Popov
6600ad6067
Add some missing EXTENSIONS sections to misc tests
2021-06-14 14:52:44 +02:00
David CARLIER
ff23a34757
define SO_ACCEPTFILTER separately where supported ( #7146 )
2021-06-14 07:24:55 +02:00
Nikita Popov
7485978339
Migrate SKIPIF -> EXTENSIONS ( #7138 )
...
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
David Carlier
fc147ed8db
sockets exposing TC_DEFER_ACCEPT to optimise tcp exchanges.
2021-06-09 06:54:02 +02:00
David Carlier
95a9e558b6
Pull #6989 FreeBSD defines SO_ACCEPTFILTER
2021-05-31 11:40:20 +02:00
Nikita Popov
7bc8f2c83f
Skip unsupported socket option test on FreeBSD
2021-05-19 09:48:22 +02:00
Nikita Popov
b9fbbcc867
Use different error condition in socket test
...
The previously used error does not occur on FreeBSD and instead
causes the operation to time out.
Also clean up the test a bit. And make sure it actually tests
something -- the point is that socket_last_error() should be 0
after socket_clear_error(). It's kind of pointless if the test
uses a wildcard for the final result instead.
2021-05-19 09:48:17 +02:00
Nikita Popov
79c9028ca6
Relax error message expectation in socket test
2021-05-18 19:34:34 +02:00
Nikita Popov
4baf340c39
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Remove getservbyname() variation tests
Use SOL_TCP instead of getprotobyname() in tests
2021-05-07 14:56:13 +02:00
Nikita Popov
0413cf3c20
Use SOL_TCP instead of getprotobyname() in tests
...
This is more idiomatic anyway, and works on msan, which misses
interceptors for getprotobyname().
2021-05-07 14:55:18 +02:00
Nikita Popov
1f04f162a6
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fixed bug #80723
2021-02-16 12:34:00 +01:00
Nikita Popov
cb9785add1
Fixed bug #80723
...
This fixes the issue just for the Socket class. Presumably we'll
want to do the same for other "resource" objects.
2021-02-16 12:33:50 +01:00
Nikita Popov
b10416a652
Deprecate passing null to non-nullable arg of internal function
...
This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.
This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)
RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg
Closes GH-6475.
2021-02-11 21:46:13 +01:00
Nikita Popov
bc0f78a2da
Use ephemeral port in socket_create_listen_used.phpt
...
Avoid parallelism issues.
2021-01-12 10:09:30 +01:00
Nikita Popov
e77ac88a44
Use ephemeral ports in mcast_ipv*_recv.phpt
2020-11-30 09:49:39 +01:00
Christoph M. Becker
a08a2b48b4
Strip trailing line breaks and periods from Windows error messages
...
PHP error messages should not contain line breaks, so we remove these
from the Windows specific error messages. We also remove trailing
periods for the same reason.
Closes GH-6423.
2020-11-12 16:42:28 +01:00
Nikita Popov
800cf5a20f
Fix double free when socket_accept fails
2020-11-11 12:48:25 +01:00