Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 527
    • Issues 527
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 101
    • Merge requests 101
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • 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 Projects
  • BINDBIND
  • Issues
  • #1642

Closed
Open
Created Feb 27, 2020 by Ondřej Surý@ondrejOwner0 of 12 tasks completed0/12 tasks

lib/dns/zone.c refactoring

While reviewing a MR that touches lib/dns/zone.c, I have notice several things:

  • zone_postload() needs to be refactored, the functions spans from line 4696 to to line 5290 (e.g. 400 lines)
  • zone_rekey() also need to be refactored as it spans from line 19317 to line 19734
  • keyfetch_done() spans from line 9993 to line 10647 (600 lines)
  • zone_nsec3chain() ~900 lines
  • The locked parameter in zone_locked() should be removed in favor of just locking the zone prior to the call
  • There's probably a missing lock in dns_zone_catz_enable_db()
  • There's probably a missing lock around dns_zone_rpz_disable_db() and dns_zone_catz_disable_db() call
  • There's lot of unlocked access to dns_zone_t members in zone_nsec3chain() and zone_sign() at the top of the function
  • There's unlocked access to dns_zone_t members in zone_maintenance() (zone->view, zone->type, zone->masters, ...)
  • There's unlocked access to zone->maxrecords in dns_zone_getmaxrecords() and dns_zone_setmaxrecords()
  • There's unlocked access to zone->origin, zone->flags, zone->dblock, and other members of dns_zone_t in zone_notify()
  • zone_rekey() contains unlocked access to zone->mctx, zone->origin, zone->rdclass and other members

The list here is neither complete or necessarily correct. Some of the struct members might be read-only (e.g. protected by reference counting), but the struct comment is saying "/* Locked */", so if they are truly read-only, perhaps casting them to const would be a right thing to do. Also I mostly checked only static functions and looked only at dns_zone_t * accesses.

Assignee
Assign to
Time tracking