[vlc-commits] amt: check IP_ADD_SOURCE_MEMBERSHIP/IP_DROP_SOURCE_MEMBERSHIP macros

KO Myung-Hun git at videolan.org
Fri Nov 29 19:14:07 CET 2019


vlc | branch: master | KO Myung-Hun <komh78 at gmail.com> | Tue Nov 19 21:17:01 2019 +0900| [3bf6a16d4bd3f5ffd1e6044b0aa5f25b5aa45d2b] | committer: Rémi Denis-Courmont

amt: check IP_ADD_SOURCE_MEMBERSHIP/IP_DROP_SOURCE_MEMBERSHIP macros

On OS/2, IP_ADD_SOURCE_MEMBERSHIP and IP_DROP_SOURCE_MEMBERSHIP macros
are not defined.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3bf6a16d4bd3f5ffd1e6044b0aa5f25b5aa45d2b
---

 modules/access/amt.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/access/amt.c b/modules/access/amt.c
index 41eb0aedef..7706bfd573 100644
--- a/modules/access/amt.c
+++ b/modules/access/amt.c
@@ -1258,6 +1258,7 @@ static bool amt_rcv_relay_mem_query( stream_t *p_access )
  * */
 static int amt_joinSSM_group( stream_t *p_access )
 {
+#ifdef IP_ADD_SOURCE_MEMBERSHIP
     struct ip_mreq_source imr;
     access_sys_t *sys = p_access->p_sys;
 
@@ -1266,6 +1267,10 @@ static int amt_joinSSM_group( stream_t *p_access )
     imr.imr_interface.s_addr = INADDR_ANY;
 
     return setsockopt( sys->sAMT, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP, (char *)&imr, sizeof(imr) );
+#else
+    errno = EINVAL;
+    return -1;
+#endif
 }
 
 static int amt_joinASM_group( stream_t *p_access )
@@ -1284,6 +1289,7 @@ static int amt_joinASM_group( stream_t *p_access )
  * */
 static int amt_leaveSSM_group( stream_t *p_access )
 {
+#ifdef IP_DROP_SOURCE_MEMBERSHIP
     struct ip_mreq_source imr;
     access_sys_t *sys = p_access->p_sys;
 
@@ -1292,6 +1298,10 @@ static int amt_leaveSSM_group( stream_t *p_access )
     imr.imr_interface.s_addr = INADDR_ANY;
 
     return setsockopt( sys->sAMT, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP, (char *)&imr, sizeof(imr) );
+#else
+    errno = EINVAL;
+    return -1;
+#endif
 }
 
 /**



More information about the vlc-commits mailing list