From 453f5ab053a98de42a8139d7d666e61252ed3c56 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Wed, 31 Jan 2024 06:58:27 +0000 Subject: [PATCH] ext/sockets: enabling multicast group for ipv4 on freebsd. (#13240) bug#75721 patch from jonathan@tangential.ca. MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP socket option for the RFC 3678 support does not work on freebsd, using IP_ADD_MEMBERSHIP instead. --- NEWS | 3 +++ ext/sockets/multicast.h | 3 ++- ext/sockets/tests/bug63000.phpt | 7 ------- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 06df7dd8fb4..cbcdcc7ac25 100644 --- a/NEWS +++ b/NEWS @@ -117,6 +117,9 @@ SimpleXML: . Fixed bug #55098 (SimpleXML iteration produces infinite loop). (nielsdos) . Fix signature of simplexml_import_dom(). (nielsdos) +Sockets: + . Added multicast group support for ipv4 on FreeBSD. (jonathan@tangential.ca) + SNMP: . Removed the deprecated inet_ntoa call support. (David Carlier) diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h index 0362b269728..f2232921c6b 100644 --- a/ext/sockets/multicast.h +++ b/ext/sockets/multicast.h @@ -14,7 +14,8 @@ +----------------------------------------------------------------------+ */ -#if defined(MCAST_JOIN_GROUP) && !defined(__APPLE__) +// TODO using setsourcefilter api on freebsd to support both ipv4/ipv6. +#if defined(MCAST_JOIN_GROUP) && !defined(__APPLE__) && !defined(__FreeBSD__) # define RFC3678_API 1 /* has block/unblock and source membership, in this case for both IPv4 and IPv6 */ # define HAS_MCAST_EXT 1 diff --git a/ext/sockets/tests/bug63000.phpt b/ext/sockets/tests/bug63000.phpt index 18f3ecbfe82..04265638a26 100644 --- a/ext/sockets/tests/bug63000.phpt +++ b/ext/sockets/tests/bug63000.phpt @@ -2,13 +2,6 @@ Bug #63000: Multicast on OSX --EXTENSIONS-- sockets ---SKIPIF-- - --FILE--