Browse code

- avoid using multicast sockets as send defaults

Andrei Pelinescu-Onciul authored on 18/10/2007 21:14:43
Showing 1 changed files
... ...
@@ -1006,7 +1006,7 @@ int main_loop()
1006 1006
 			if (udp_init(si)==-1) goto error;
1007 1007
 			/* get first ipv4/ipv6 socket*/
1008 1008
 			if ((si->address.af==AF_INET)&&
1009
-					((sendipv4==0)||(sendipv4->flags&SI_IS_LO)))
1009
+					((sendipv4==0)||(sendipv4->flags&(SI_IS_LO|SI_IS_MCAST))))
1010 1010
 				sendipv4=si;
1011 1011
 	#ifdef USE_IPV6
1012 1012
 			if((sendipv6==0)&&(si->address.af==AF_INET6))
... ...
@@ -1020,7 +1020,8 @@ int main_loop()
1020 1020
 				if (tcp_init(si)==-1)  goto error;
1021 1021
 				/* get first ipv4/ipv6 socket*/
1022 1022
 				if ((si->address.af==AF_INET)&&
1023
-						((sendipv4_tcp==0)||(sendipv4_tcp->flags&SI_IS_LO)))
1023
+						((sendipv4_tcp==0)||
1024
+						 	(sendipv4_tcp->flags&(SI_IS_LO|SI_IS_MCAST))))
1024 1025
 					sendipv4_tcp=si;
1025 1026
 		#ifdef USE_IPV6
1026 1027
 				if((sendipv6_tcp==0)&&(si->address.af==AF_INET6))
... ...
@@ -1035,7 +1036,8 @@ int main_loop()
1035 1035
 				if (tls_init(si)==-1)  goto error;
1036 1036
 				/* get first ipv4/ipv6 socket*/
1037 1037
 				if ((si->address.af==AF_INET)&&
1038
-						((sendipv4_tls==0)||(sendipv4_tls->flags&SI_IS_LO)))
1038
+						((sendipv4_tls==0)||
1039
+						 	(sendipv4_tls->flags&(SI_IS_LO|SI_IS_MCAST))))
1039 1040
 					sendipv4_tls=si;
1040 1041
 		#ifdef USE_IPV6
1041 1042
 				if((sendipv6_tls==0)&&(si->address.af==AF_INET6))