summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2012-11-26 12:24:51 -0800
committerShawn Routhier <sar@isc.org>2012-11-26 12:24:51 -0800
commit9216ad2ff5cddde2f6d51e069cd7f763c6daf908 (patch)
tree088974b19e1b4f33b3e0bdc37b7dfd0d3385ae34
parentd7ba1d37f7a4dce5dd492ac51e32e02fe6978630 (diff)
downloadisc-dhcp-9216ad2ff5cddde2f6d51e069cd7f763c6daf908.tar.gz
-n [v4_2]
[rt31231] Check the status when trying to read from a connection and don't ask for more if we seem to have a closed connection. [ISC-Bugs #31231]
-rw-r--r--RELNOTES6
-rw-r--r--omapip/dispatch.c11
2 files changed, 15 insertions, 2 deletions
diff --git a/RELNOTES b/RELNOTES
index 58d0b5de..b8ada0da 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -161,6 +161,12 @@ work on other platforms. Please report any problems and suggested fixes to
dhcpd.conf file as desired.
[ISC-Bugs #19337]
+- Check the status value when trying to read from a connection to
+ see if it may have been closed. If it appears closed don't try
+ to read from it again. This avoids a potential busy-wait like
+ loop when the peer names are mismatched.
+ [ISC-Bugs #31231]
+
Changes since 4.2.4rc2
- None
diff --git a/omapip/dispatch.c b/omapip/dispatch.c
index 4039659a..e6aae453 100644
--- a/omapip/dispatch.c
+++ b/omapip/dispatch.c
@@ -171,8 +171,15 @@ omapi_iscsock_cb(isc_task_t *task,
if ((flags == ISC_SOCKFDWATCH_READ) &&
(obj->reader != NULL) &&
(obj->inner != NULL)) {
- obj->reader(obj->inner);
- /* We always ask for more when reading */
+ status = obj->reader(obj->inner);
+ /*
+ * If we are shutting down (basically tried to
+ * read and got no bytes) we don't need to try
+ * again.
+ */
+ if (status == ISC_R_SHUTTINGDOWN)
+ return (0);
+ /* Otherwise We always ask for more when reading */
return (1);
} else if ((flags == ISC_SOCKFDWATCH_WRITE) &&
(obj->writer != NULL) &&