Browse code

- fixed no fork w/ no udp listen addresses bug (not allowed)

Andrei Pelinescu-Onciul authored on 29/10/2003 15:56:15
Showing 1 changed files
... ...
@@ -767,6 +767,11 @@ int main_loop()
767 767
 #ifdef STATS
768 768
 		setstats( 0 );
769 769
 #endif
770
+		if (udp_listen==0){
771
+			LOG(L_ERR, "ERROR: no fork mode requires at least one"
772
+					" udp listen address, exiting...\n");
773
+			goto error;
774
+		}
770 775
 		/* only one address, we ignore all the others */
771 776
 		if (udp_init(udp_listen)==-1) goto error;
772 777
 		bind_address=udp_listen;
... ...
@@ -1380,8 +1385,10 @@ try_again:
1380 1380
 	
1381 1381
 	if (dont_fork){
1382 1382
 		fprintf(stderr, "WARNING: no fork mode %s\n", 
1383
+				(udp_listen)?(
1383 1384
 				(udp_listen->next)?" and more than one listen address found"
1384
-				"(will use only the the first one)":"");
1385
+				"(will use only the the first one)":""
1386
+				):"and no udp listen address found" );
1385 1387
 	}
1386 1388
 	if (config_check){
1387 1389
 		fprintf(stderr, "config file ok, exiting...\n");