From: Shawn Routhier Date: Mon, 26 Nov 2012 20:14:27 +0000 (-0800) Subject: [master] X-Git-Tag: v4_3_0a1~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e2a127bfeb23448c2594167b9bf09f585a52259;p=thirdparty%2Fdhcp.git [master] [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] --- diff --git a/RELNOTES b/RELNOTES index 12ddfc8a6..e9a198ecc 100644 --- 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. diff --git a/omapip/dispatch.c b/omapip/dispatch.c index 4039659ac..e6aae4538 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) &&