Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 565
    • Issues 565
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 93
    • Merge requests 93
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • BINDBIND
  • Issues
  • #2239
Closed
Open
Issue created Oct 28, 2020 by Michael McNally@McNally

fctx:id is uninitialized and effectively unused

On Support #17250 Jinmei has another suggestion for us based on his review of the code:

I've just noticed the 'id' field of struct fctx (defined in lib/dns/resolver.c) is not initialized, and the uninitialized value is used only for logging (so effectively unused). This field seems to be introduced in 2018 at commit f2af336d with initialization, but has been effectively removed at some point (I've not figured out exactly when). I suspect it's really unnecessary today and it should have been cleaned up. The attached patch is one trivial way to clean it up (the fact that it compiles should also prove it's unused otherwise).

Pretty minor though, except that a bogus 'id' value could be included in a debug log message.

He suggests the following patch:

diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
index 1dd82a0300..020399db80 100644
--- a/lib/dns/resolver.c
+++ b/lib/dns/resolver.c
@@ -400,7 +400,6 @@ struct fetchctx {
 	unsigned int valfail;
 	bool timeout;
 	dns_adbaddrinfo_t *addrinfo;
-	dns_messageid_t id;
 	unsigned int depth;
 	char clientstr[ISC_SOCKADDR_FORMATSIZE];
 };
@@ -3446,8 +3445,8 @@ findname(fetchctx_t *fctx, const dns_name_t *name, in_port_t port,
 
 	isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
 		      DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3),
-		      "fctx %p(%s): createfind for %s/%d - %s", fctx,
-		      fctx->info, fctx->clientstr, fctx->id,
+		      "fctx %p(%s): createfind for %s - %s", fctx,
+		      fctx->info, fctx->clientstr,
 		      isc_result_totext(result));
 
 	if (result != ISC_R_SUCCESS) {
Assignee
Assign to
Time tracking