[Sumover-dev] [svn commit] r4113 - vic/branches/mpeg4/net

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Tue Dec 11 16:48:08 GMT 2007


Author: turam
Date: Tue Dec 11 16:48:06 2007
New Revision: 4113

Modified:
   vic/branches/mpeg4/net/net-ip.cpp

Log:
If noMulticastBind option is set, bail out of openrsock early

Modified: vic/branches/mpeg4/net/net-ip.cpp
==============================================================================
--- vic/branches/mpeg4/net/net-ip.cpp	(original)
+++ vic/branches/mpeg4/net/net-ip.cpp	Tue Dec 11 16:48:06 2007
@@ -323,6 +323,14 @@
 	u_int32_t g_addri_ssm = (IPAddress&)s_addr_ssm;
 	u_int32_t locali = (IPAddress&)local;
 
+	Tcl tcl = Tcl::instance();
+	const char *noBindStr;
+
+	noBindStr = tcl.attr("noMulticastBind");
+        if(noBindStr != NULL && strcasecmp(noBindStr,"true") == 0) {
+            return -1;
+        }
+
 	fd = socket(AF_INET, SOCK_DGRAM, 0);
 	if (fd < 0) {
 		perror("socket");
@@ -361,16 +369,6 @@
 				exit(1);
 			}
 		}
-/* See if the noMulticastBind flag is set */
-
-		Tcl tcl = Tcl::instance();
-		const char *noBindStr;
-		int noBind = 0;
-
-		if ((noBindStr = tcl.attr("noMulticastBind")) != NULL)
-		{
-			noBind = (strcasecmp(noBindStr, "true") == 0);
-		}
 		/* 
 		 * XXX This is bogus multicast setup that really
 		 * shouldn't have to be done (group membership should be
@@ -380,8 +378,6 @@
 		 * with bated breath.
 		 */
 
-		if (!noBind)
-		{
 		/* SSM code */
 #ifdef IP_ADD_SOURCE_MEMBERSHIP  
         struct ip_mreq_source mrs;
@@ -417,7 +413,6 @@
 					exit(1);
 				}
 		}
-		}
 	} else
 #endif /* IP_ADD_MEMBERSHIP */
 	{



More information about the Sumover-dev mailing list