Blame SOURCES/dhcp-max-fd-value.patch

6736f5
diff -up dhcp-4.2.5/includes/site.h.max-fd dhcp-4.2.5/includes/site.h
6736f5
--- dhcp-4.2.5/includes/site.h.max-fd	2016-04-21 15:15:14.618846830 +0200
6736f5
+++ dhcp-4.2.5/includes/site.h	2016-04-21 15:17:06.529731652 +0200
6736f5
@@ -275,3 +275,9 @@
6736f5
    Care should be taken before enabling this option. */
6736f5
 
6736f5
 /* #define SERVER_ID_CHECK */
6736f5
+
6736f5
+/* Limit the value of a file descriptor the serve will use
6736f5
+   when accepting a connecting request.  This can be used to
6736f5
+   limit the number of TCP connections that the server will
6736f5
+   allow at one time.  A value of 0 means there is no limit.*/
6736f5
+#define MAX_FD_VALUE 200
6736f5
diff -up dhcp-4.2.5/omapip/listener.c.max-fd dhcp-4.2.5/omapip/listener.c
6736f5
--- dhcp-4.2.5/omapip/listener.c.max-fd	2013-01-03 01:02:24.000000000 +0100
6736f5
+++ dhcp-4.2.5/omapip/listener.c	2016-04-21 15:15:14.618846830 +0200
6736f5
@@ -239,7 +239,12 @@ isc_result_t omapi_accept (omapi_object_
6736f5
 			return ISC_R_NORESOURCES;
6736f5
 		return ISC_R_UNEXPECTED;
6736f5
 	}
6736f5
-	
6736f5
+
6736f5
+	if ((MAX_FD_VALUE != 0) && (socket > MAX_FD_VALUE)) {
6736f5
+		close(socket);
6736f5
+		return (ISC_R_NORESOURCES);
6736f5
+	}
6736f5
+
6736f5
 #if defined (TRACING)
6736f5
 	/* If we're recording a trace, remember the connection. */
6736f5
 	if (trace_record ()) {