[Spread-cvs] commit: r369 - trunk/daemon

jonathan at spread.org jonathan at spread.org
Fri Nov 17 13:47:07 EST 2006


Author: jonathan
Date: 2006-11-17 13:47:07 -0500 (Fri, 17 Nov 2006)
New Revision: 369

Modified:
   trunk/daemon/Changelog
   trunk/daemon/network.c
Log:
Bugfix for Windows. Only on windows we should not
bind to the broadcast address if we are binding to specific interfaces.
Bug reported by Michael Chelnokov.


Modified: trunk/daemon/Changelog
===================================================================
--- trunk/daemon/Changelog	2006-11-17 18:38:38 UTC (rev 368)
+++ trunk/daemon/Changelog	2006-11-17 18:47:07 UTC (rev 369)
@@ -1,3 +1,10 @@
+Fri Nov 17 13:43:42 2006  Jonathan Stanton  <jonathan at cnds.jhu.edu>
+
+	* network.c (Net_init): Do not bind to broadcast address
+	on windows,as it is not permitted. Sockets bound to specific
+	interfaces on windows will also receive broadcasts. Bug 
+	reported by Michael Chelnokov.
+
 Fri Nov 17 13:36:12 2006  Jonathan Stanton  <jonathan at cnds.jhu.edu>
 
 	* groups.c (G_mess_to_groups,G_build_groups_buf): Fix race

Modified: trunk/daemon/network.c
===================================================================
--- trunk/daemon/network.c	2006-11-17 18:38:38 UTC (rev 368)
+++ trunk/daemon/network.c	2006-11-17 18:47:07 UTC (rev 369)
@@ -119,6 +119,10 @@
          * bound to a specific interface, we also have to bind to the broadcast
          * address on the interface as well as the unicast interface. That is 
          * what the double bind of the bcast_address does.
+         * 
+         * The above statement is not true for Windows -- there binding to 
+         * the broadcast address is forbidden. So we do not compile in the
+         * bind call on windows.
          */
         for ( i=0; i < My.num_if; i++)
         {
@@ -129,7 +133,9 @@
                         else {
                                 interface_addr = My.ifc[i].ip;
                                 if (Bcast_needed && !bcast_bound) {
+#ifndef ARCH_PC_WIN95
                                     Bcast_channel[Num_bcast_channels++] = DL_init_channel( RECV_CHANNEL, My.port, Bcast_address, Bcast_address );
+#endif
                                     bcast_bound = TRUE;
                                 }
                         }




More information about the Spread-cvs mailing list