Browse code

core: take into account mhomed when estimated max_fd_no

Since commit ead9f3f, mhomed might use 1 or 2 (IPV6 enabled) fds
per process for caching socket descriptors.

Andrei Pelinescu-Onciul authored on 01/02/2010 18:55:30
Showing 1 changed files
... ...
@@ -89,11 +89,20 @@ static int calc_common_open_fds_no()
89 89
 	/* 1 tcp send unix socket/all_proc, 
90 90
 	 *  + 1 udp sock/udp proc + 1 possible dns comm. socket + 
91 91
 	 *  + 1 temporary tcp send sock.
92
+	 * Per process:
93
+	 *  + 1 if mhomed (now mhomed keeps a "cached socket" per process)
94
+	 *  + 1 if mhomed & ipv6
92 95
 	 */
93 96
 	max_fds_no=estimated_proc_no*4 /* udp|sctp + tcp unix sock +
94 97
 									  tmp. tcp send +
95 98
 									  tmp dns.*/
96
-				-1 /* timer (no udp)*/ + 3 /* stdin/out/err */;
99
+				-1 /* timer (no udp)*/ + 3 /* stdin/out/err */ +
100
+#ifdef USE_IPV6
101
+				2*mhomed
102
+#else
103
+				mhomed
104
+#endif /* USE_IPV6*/
105
+				;
97 106
 	return max_fds_no;
98 107
 }
99 108