summaryrefslogtreecommitdiff
path: root/omapip
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2016-03-04 12:16:52 -0800
committerShawn Routhier <sar@isc.org>2016-03-04 12:16:52 -0800
commit0b209ea5cc333255e055113fa2ad636dda681a21 (patch)
tree7b0d001c0f190be903a5cd14679ed5b2e37f1339 /omapip
parentcc1bd34e09bad3313a16d89f7ad491ff16754dc7 (diff)
downloadisc-dhcp-0b209ea5cc333255e055113fa2ad636dda681a21.tar.gz
[master] Add patch to limit the value of an fd we accept for a connection.
By limiting the highest value we accept for an fd we limit the number of connections.
Diffstat (limited to 'omapip')
-rw-r--r--omapip/listener.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/omapip/listener.c b/omapip/listener.c
index 8bdcdbd7..61473cf5 100644
--- a/omapip/listener.c
+++ b/omapip/listener.c
@@ -3,7 +3,7 @@
Subroutines that support the generic listener object. */
/*
- * Copyright (c) 2012,2014 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2012,2014,2016 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999-2003 by Internet Software Consortium
*
@@ -233,7 +233,12 @@ isc_result_t omapi_accept (omapi_object_t *h)
return ISC_R_NORESOURCES;
return ISC_R_UNEXPECTED;
}
-
+
+ if ((MAX_FD_VALUE != 0) && (socket > MAX_FD_VALUE)) {
+ close(socket);
+ return (ISC_R_NORESOURCES);
+ }
+
#if defined (TRACING)
/* If we're recording a trace, remember the connection. */
if (trace_record ()) {