+2789. [bug] Fixed an INSIST in dispatch.c [RT #20576]
+
2788. [bug] dnssec-signzone could sign with keys that were
not requested [RT #20625]
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dispatch.c,v 1.164 2009/09/01 00:22:26 jinmei Exp $ */
+/* $Id: dispatch.c,v 1.165 2009/11/25 05:55:32 each Exp $ */
/*! \file */
return (portentry);
}
+/*%
+ * The caller must not hold the qid->lock.
+ */
static void
deref_portentry(dns_dispatch_t *disp, dispportentry_t **portentryp) {
dispportentry_t *portentry = *portentryp;
REQUIRE(disp->port_table != NULL);
REQUIRE(portentry != NULL && portentry->refs > 0);
+ dns_qid_t *qid;
+ qid = DNS_QID(disp);
+ LOCK(&qid->lock);
portentry->refs--;
if (portentry->refs == 0) {
ISC_LIST_UNLINK(disp->port_table[portentry->port %
}
*portentryp = NULL;
+ UNLOCK(&qid->lock);
}
/*%
dispsock = ISC_LIST_HEAD(qid->sock_table[bucket]);
while (dispsock != NULL) {
- if (isc_sockaddr_equal(dest, &dispsock->host) &&
- dispsock->portentry->port == port)
+ if (dispsock->portentry != NULL &&
+ dispsock->portentry->port == port &&
+ isc_sockaddr_equal(dest, &dispsock->host))
return (dispsock);
dispsock = ISC_LIST_NEXT(dispsock, blink);
}