mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-07 03:02:17 +00:00
only use struct ip_mreqn if it is detected
* configure.ac: Make an explicit check for struct ip_mreqn. * gst/udp/gstudpnetutils.c: Use HAVE_IP_MREQN instead of the ad-hoc checks.
This commit is contained in:
parent
cfcf76df11
commit
07dcbacd60
2 changed files with 12 additions and 6 deletions
|
@ -179,6 +179,12 @@ dnl Check for mmap (needed by electricfence plugin)
|
||||||
AC_FUNC_MMAP
|
AC_FUNC_MMAP
|
||||||
AM_CONDITIONAL(GST_HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" == "xyes")
|
AM_CONDITIONAL(GST_HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" == "xyes")
|
||||||
|
|
||||||
|
dnl Check for mmap (needed by electricfence plugin)
|
||||||
|
|
||||||
|
AC_CHECK_TYPE([struct ip_mreqn], [
|
||||||
|
AC_DEFINE(HAVE_IP_MREQN,, [Define if we have struct ip_mreqn])],,
|
||||||
|
[#include <netinet/in.h>])
|
||||||
|
|
||||||
dnl *** checks for dependency libraries ***
|
dnl *** checks for dependency libraries ***
|
||||||
|
|
||||||
dnl GLib is required
|
dnl GLib is required
|
||||||
|
|
|
@ -172,21 +172,21 @@ gst_udp_join_group (int sockfd, struct sockaddr_storage *addr, gchar * iface)
|
||||||
switch (addr->ss_family) {
|
switch (addr->ss_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
{
|
{
|
||||||
#if defined (G_OS_WIN32) || (defined (__SVR4) && defined (__sun))
|
#ifdef HAVE_IP_MREQN
|
||||||
struct ip_mreq mreq4;
|
|
||||||
#else
|
|
||||||
struct ip_mreqn mreq4;
|
struct ip_mreqn mreq4;
|
||||||
|
#else
|
||||||
|
struct ip_mreq mreq4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mreq4.imr_multiaddr.s_addr =
|
mreq4.imr_multiaddr.s_addr =
|
||||||
((struct sockaddr_in *) addr)->sin_addr.s_addr;
|
((struct sockaddr_in *) addr)->sin_addr.s_addr;
|
||||||
#if defined (G_OS_WIN32) || (defined (__SVR4) && defined (__sun))
|
#if HAVE_IP_MREQN
|
||||||
mreq4.imr_interface.s_addr = INADDR_ANY;
|
|
||||||
#else
|
|
||||||
if (iface)
|
if (iface)
|
||||||
mreq4.imr_ifindex = if_nametoindex (iface);
|
mreq4.imr_ifindex = if_nametoindex (iface);
|
||||||
else
|
else
|
||||||
mreq4.imr_ifindex = 0; /* Pick any. */
|
mreq4.imr_ifindex = 0; /* Pick any. */
|
||||||
|
#else
|
||||||
|
mreq4.imr_interface.s_addr = INADDR_ANY;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((ret =
|
if ((ret =
|
||||||
|
|
Loading…
Reference in a new issue