From fa7914feb47e585dc38fdf610d2a2856699657ce Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 24 Jan 2024 20:53:24 +0000 Subject: [PATCH] ext/sockets: enabling multicast group for ipv4 on freebsd. 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 06df7dd8fb44e..cbcdcc7ac2569 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 0362b269728f1..f2232921c6b93 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 18f3ecbfe825d..04265638a260d 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--