Skip to content

Commit 453f5ab

Browse files
authored
ext/sockets: enabling multicast group for ipv4 on freebsd. (#13240)
bug#75721 patch from [email protected]. MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP socket option for the RFC 3678 support does not work on freebsd, using IP_ADD_MEMBERSHIP instead.
1 parent 4a08f41 commit 453f5ab

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ SimpleXML:
117117
. Fixed bug #55098 (SimpleXML iteration produces infinite loop). (nielsdos)
118118
. Fix signature of simplexml_import_dom(). (nielsdos)
119119

120+
Sockets:
121+
. Added multicast group support for ipv4 on FreeBSD. ([email protected])
122+
120123
SNMP:
121124
. Removed the deprecated inet_ntoa call support. (David Carlier)
122125

ext/sockets/multicast.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
#if defined(MCAST_JOIN_GROUP) && !defined(__APPLE__)
17+
// TODO using setsourcefilter api on freebsd to support both ipv4/ipv6.
18+
#if defined(MCAST_JOIN_GROUP) && !defined(__APPLE__) && !defined(__FreeBSD__)
1819
# define RFC3678_API 1
1920
/* has block/unblock and source membership, in this case for both IPv4 and IPv6 */
2021
# define HAS_MCAST_EXT 1

ext/sockets/tests/bug63000.phpt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
Bug #63000: Multicast on OSX
33
--EXTENSIONS--
44
sockets
5-
--SKIPIF--
6-
<?php
7-
8-
if (str_contains(PHP_OS, 'FreeBSD')) {
9-
die('skip option not supported on FreeBSD');
10-
}
11-
?>
125
--FILE--
136
<?php
147
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);

0 commit comments

Comments
 (0)