Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
BIND
BIND
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 583
    • Issues 583
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 110
    • Merge Requests 110
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • ISC Open Source Projects
  • BINDBIND
  • Issues
  • #2239

Closed
Open
Opened Oct 28, 2020 by Michael McNally@McNallyDeveloper

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
November 2020 (9.11.25, 9.11.25-S1, 9.16.9, 9.16.9-S1, 9.17.7)
Milestone
November 2020 (9.11.25, 9.11.25-S1, 9.16.9, 9.16.9-S1, 9.17.7) (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: isc-projects/bind9#2239