Skip to content
Cloudflare

Making code better with reviews

Jul 2, 2014John Graham-Cumming3 min read
Opens blog.cloudflare.com
What the post coversAI, from the source post

This post details a specific code improvement within Cloudflare's DNS server related to filtering invalid DNS packet flags.

  • The author initially added a comment to explain a bitmask check (`0x86` and `0x4f`).
  • A code review led to a refactoring that replaced the magic numbers with named constants (`QR`, `AA`, `TC`, `Z`, `RCODE`) and a more explicit bitwise OR operation, significantly improving code readability and maintainability.
  • This demonstrates the impact of code reviews on improving code quality and security.
Read the full post on blog.cloudflare.com · 3 min (opens in a new tab)

More from the DNS Infrastructure & Naming Conventions trail