]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master]
authorShawn Routhier <sar@isc.org>
Mon, 26 Nov 2012 20:14:27 +0000 (12:14 -0800)
committerShawn Routhier <sar@isc.org>
Mon, 26 Nov 2012 20:14:27 +0000 (12:14 -0800)
[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]

RELNOTES
omapip/dispatch.c

index 12ddfc8a6e1ae0df47b87c13df7b340e3b9aa523..e9a198eccf5a1e1387d820cd7ffc15fa7b08d784 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -178,6 +178,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.3
 
 ! Add a check for a null pointer before calling the regexec function.
index 4039659ac71fe619fd7aef15fe058e6b4208912b..e6aae45384477f77f9c4a2cae23e8abced92e139 100644 (file)
@@ -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) &&