--- 9.12.0rc3 released ---
+4863. [bug] Fix various other bugs reported by Valgrind's
+ memcheck tool. [RT #46978]
+
4862. [bug] The rdata flags for RRSIG were not being properly set
when constructing a rdataslab. [RT #46978]
unsigned int magic;
dns_view_t *view;
isc_rwlock_t rwlock;
- isc_uint32_t recheck;
isc_taskmgr_t *taskmgr;
isc_timermgr_t *timermgr;
isc_task_t *task;
isc_result_t
dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
dns_message_t *msg);
+isc_result_t
+dns_zone_notifyreceive2(dns_zone_t *zone, isc_sockaddr_t *from,
+ isc_sockaddr_t *to, dns_message_t *msg);
/*%<
* Tell the zone that it has received a NOTIFY message from another
* server. This may cause some zone maintenance activity to occur.
* If we're expiring before the next recheck, we might
* as well stop the timer now.
*/
- if (nta->timer != NULL && nta->expiry - now < ntatable->recheck)
+ if (nta->timer != NULL && nta->expiry - now < view->nta_recheck)
(void) isc_timer_reset(nta->timer, isc_timertype_inactive,
NULL, NULL, ISC_TRUE);
nta_detach(view->mctx, &nta);
region->base = rawbuf;
region->length = buflen;
+ memset(rawbuf, 0, buflen);
rawbuf += reservelen;
+
#if DNS_RDATASET_FIXED
offsetbase = rawbuf;
#endif
query->sends = 0;
query->connects = 0;
query->dscp = addrinfo->dscp;
+ query->udpsize = 0;
/*
* Note that the caller MUST guarantee that 'addrinfo' will remain
* valid until this query is canceled.
dns_zone_next
dns_zone_notify
dns_zone_notifyreceive
+dns_zone_notifyreceive2
dns_zone_nscheck
dns_zone_refresh
dns_zone_rekey
zone->rss_event = NULL;
zone->rss_state = NULL;
zone->updatemethod = dns_updatemethod_increment;
+ zone->maxrecords = 0U;
zone->magic = ZONE_MAGIC;
isc_result_t
dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
dns_message_t *msg)
+{
+ return (dns_zone_notifyreceive2(zone, from, NULL, msg));
+}
+
+isc_result_t
+dns_zone_notifyreceive2(dns_zone_t *zone, isc_sockaddr_t *from,
+ isc_sockaddr_t *to, dns_message_t *msg)
{
unsigned int i;
dns_rdata_soa_t soa;
char fromtext[ISC_SOCKADDR_FORMATSIZE];
int match = 0;
isc_netaddr_t netaddr;
- isc_sockaddr_t local, remote;
isc_uint32_t serial = 0;
isc_boolean_t have_serial = ISC_FALSE;
dns_tsigkey_t *tsigkey;
LOCK_ZONE(zone);
INSIST(zone != zone->raw);
if (inline_secure(zone)) {
- result = dns_zone_notifyreceive(zone->raw, from, msg);
+ result = dns_zone_notifyreceive2(zone->raw, from, to, msg);
UNLOCK_ZONE(zone);
return (result);
}
dns_zone_log(zone, ISC_LOG_INFO, "notify from %s: no serial",
fromtext);
zone->notifyfrom = *from;
- remote = zone->masteraddr;
- local = zone->sourceaddr;
UNLOCK_ZONE(zone);
- dns_zonemgr_unreachabledel(zone->zmgr, &remote, &local);
+
+ if (to != NULL) {
+ dns_zonemgr_unreachabledel(zone->zmgr, from, to);
+ }
dns_zone_refresh(zone);
return (ISC_R_SUCCESS);
}
dns_nsec3param_toprivate(&nrdata, &prdata, zone->privatetype,
np->data, sizeof(np->data));
np->length = prdata.length;
+ np->nsec = ISC_FALSE;
}
zone_iattach(zone, &dummy);
#endif
memset(msg, 0, sizeof(*msg));
+ if (sock->sendcmsgbuflen != 0U) {
+ memset(sock->sendcmsgbuf, 0, sock->sendcmsgbuflen);
+ }
if (!sock->connected) {
msg->msg_name = (void *)&dev->address.type.sa;
}
}
+ isc_sockaddr_fromnetaddr(&client->destsockaddr, &client->destaddr, 0);
+
if ((client->attributes & NS_CLIENTATTR_HAVEECS) != 0) {
ecs = &client->ecs;
}
return (&client->peeraddr);
}
+isc_sockaddr_t *
+ns_client_getdestaddr(ns_client_t *client) {
+ return (&client->destsockaddr);
+}
+
isc_result_t
ns_client_checkaclsilent(ns_client_t *client, isc_netaddr_t *netaddr,
dns_acl_t *acl, isc_boolean_t default_allow)
isc_sockaddr_t peeraddr;
isc_boolean_t peeraddr_valid;
isc_netaddr_t destaddr;
+ isc_sockaddr_t destsockaddr;
dns_ecs_t ecs; /*%< EDNS client subnet sent by client */
* currently being processed.
*/
+isc_sockaddr_t *
+ns_client_getdestaddr(ns_client_t *client);
+/*%<
+ * Get the destination address (server) for the request that is
+ * currently being processed.
+ */
+
isc_result_t
ns_client_checkaclsilent(ns_client_t *client, isc_netaddr_t *netaddr,
dns_acl_t *acl, isc_boolean_t default_allow);
if (result != ISC_R_SUCCESS) {
notify_log(client, ISC_LOG_NOTICE,
"notify question section empty");
- goto formerr;
+ result = DNS_R_FORMERR;
+ goto done;
}
/*
if (ISC_LIST_NEXT(zone_rdataset, link) != NULL) {
notify_log(client, ISC_LOG_NOTICE,
"notify question section contains multiple RRs");
- goto formerr;
+ result = DNS_R_FORMERR;
+ goto done;
}
/* The zone section must have exactly one name. */
if (result != ISC_R_NOMORE) {
notify_log(client, ISC_LOG_NOTICE,
"notify question section contains multiple RRs");
- goto formerr;
+ result = DNS_R_FORMERR;
+ goto done;
}
/* The one rdataset must be an SOA. */
if (zone_rdataset->type != dns_rdatatype_soa) {
notify_log(client, ISC_LOG_NOTICE,
"notify question section contains no SOA");
- goto formerr;
+ result = DNS_R_FORMERR;
+ goto done;
}
tsigkey = dns_message_gettsigkey(request);
}
} else
tsigbuf[0] = '\0';
+
dns_name_format(zonename, namebuf, sizeof(namebuf));
- result = dns_zt_find(client->view->zonetable, zonename, 0, NULL,
- &zone);
- if (result != ISC_R_SUCCESS)
- goto notauth;
-
- switch (dns_zone_gettype(zone)) {
- case dns_zone_master:
- case dns_zone_slave:
- case dns_zone_stub: /* Allow dialup passive to work. */
- notify_log(client, ISC_LOG_INFO,
- "received notify for zone '%s'%s", namebuf, tsigbuf);
- respond(client, dns_zone_notifyreceive(zone,
- ns_client_getsockaddr(client), request));
- break;
- default:
- goto notauth;
+ result = dns_zt_find(client->view->zonetable, zonename, 0, NULL, &zone);
+ if (result == ISC_R_SUCCESS) {
+ dns_zonetype_t zonetype = dns_zone_gettype(zone);
+
+ if ((zonetype == dns_zone_master) ||
+ (zonetype == dns_zone_slave) ||
+ (zonetype == dns_zone_stub))
+ {
+ isc_sockaddr_t *from = ns_client_getsockaddr(client);
+ isc_sockaddr_t *to = ns_client_getdestaddr(client);
+ notify_log(client, ISC_LOG_INFO,
+ "received notify for zone '%s'%s",
+ namebuf, tsigbuf);
+ result = dns_zone_notifyreceive2(zone, from, to,
+ request);
+ goto done;
+ }
}
- dns_zone_detach(&zone);
- return;
- notauth:
notify_log(client, ISC_LOG_NOTICE,
"received notify for zone '%s'%s: not authoritative",
namebuf, tsigbuf);
result = DNS_R_NOTAUTH;
- goto failure;
-
- formerr:
- result = DNS_R_FORMERR;
- failure:
+ done:
if (zone != NULL)
dns_zone_detach(&zone);
respond(client, result);
ns_client_dumprecursing
ns_client_error
ns_client_getsockaddr
+ns_client_getdestaddr
ns_client_killoldestquery
ns_client_log
ns_client_logv