[sr-dev] git:master:70262d30: core: fix compilation on platforms without struct ip_mreqn

Daniel-Constantin Mierla miconda at gmail.com
Sat Nov 12 11:55:04 CET 2016


Module: kamailio
Branch: master
Commit: 70262d3063376be34b784d0f6ffec4083779640c
URL: https://github.com/kamailio/kamailio/commit/70262d3063376be34b784d0f6ffec4083779640c

Author: Mikko Lehto <mslehto at iki.fi>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-11-12T11:54:58+01:00

core: fix compilation on platforms without struct ip_mreqn

- collateral by new mcast feature (commit 8b39cb6a3aa37d26da1ccf8f55f25aaba8fc4613)

---

Modified: udp_server.c

---

Diff:  https://github.com/kamailio/kamailio/commit/70262d3063376be34b784d0f6ffec4083779640c.diff
Patch: https://github.com/kamailio/kamailio/commit/70262d3063376be34b784d0f6ffec4083779640c.patch

---

diff --git a/udp_server.c b/udp_server.c
index b809b60..60cb3c0 100644
--- a/udp_server.c
+++ b/udp_server.c
@@ -215,18 +215,26 @@ int probe_max_receive_buffer( int udp_sock )
  */
 static int setup_mcast_rcvr(int sock, union sockaddr_union* addr, char* interface)
 {
+#ifdef HAVE_IP_MREQN
 	struct ip_mreqn mreq;
+#else
+	struct ip_mreq mreq;
+#endif
 	struct ipv6_mreq mreq6;
 
 	if (addr->s.sa_family==AF_INET){
 		memcpy(&mreq.imr_multiaddr, &addr->sin.sin_addr, 
 		       sizeof(struct in_addr));
+#ifdef HAVE_IP_MREQN
 		if (interface!=0) {
 			mreq.imr_ifindex = if_nametoindex(interface);
 		} else {
 			mreq.imr_ifindex = 0;
 		}
 		mreq.imr_address.s_addr = htonl(INADDR_ANY);
+#else
+		mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+#endif
 		
 		if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,&mreq,
 			       sizeof(mreq))==-1){




More information about the sr-dev mailing list