[PR #1994] [CLOSED] Authority can depend on client source ipnet #2745

Closed
opened 2026-03-16 11:06:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1994
Author: @dxfgg17
Created: 7/26/2023
Status: Closed

Base: mainHead: main


📝 Commits (3)

  • 56851b4 Authority can depend on client source ipnet
  • abcd7b7 Merge branch 'bluejekyll:main' into main
  • 0da2a0a Fix from trust-dns/main

📊 Changes

3 files changed (+163 additions, -20 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 crates/server/Cargo.toml (+1 -0)
📝 crates/server/src/authority/catalog.rs (+161 -20)

📄 Description

I thought it could be useful to answer differently to clients depending on their source ip network.

There is no breaking change (existing functions still work the same way) but I added the two following functions in the catalog.rs file:

pub fn upsert_for_ipnet(
    &mut self,
    ipnet: IpNet,
    name: LowerName,
    authority: Box<dyn AuthorityObject>,
)

pub fn remove_for_ipnet(
    &mut self,
    ipnet: &IpNet,
    name: &LowerName,
) -> Option<Box<dyn AuthorityObject>>

Now, authorities are stored like this:

authorities: vec![(None, HashMap::new())],

There is a small performance overhead when adding an AuthorityObject because the vector has to be sorted to have at the first position the smallest IpNet and last position the biggest one (which is None, corresponding to all networks and to the current behaviour, all networks).

If this is not a wanted behavior or functionnalty feel free to delete this, I won't be offended it was just something I needed :)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/1994 **Author:** [@dxfgg17](https://github.com/dxfgg17) **Created:** 7/26/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`56851b4`](https://github.com/hickory-dns/hickory-dns/commit/56851b43633ea64c713a21d5ade065161772d338) Authority can depend on client source ipnet - [`abcd7b7`](https://github.com/hickory-dns/hickory-dns/commit/abcd7b71c80f11b15fda20380a91b457a0880ec7) Merge branch 'bluejekyll:main' into main - [`0da2a0a`](https://github.com/hickory-dns/hickory-dns/commit/0da2a0a0ee30a6f6e15e64ae4f70e2aeca9eb62a) Fix from trust-dns/main ### 📊 Changes **3 files changed** (+163 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `crates/server/Cargo.toml` (+1 -0) 📝 `crates/server/src/authority/catalog.rs` (+161 -20) </details> ### 📄 Description I thought it could be useful to answer differently to clients depending on their source ip network. There is no breaking change (existing functions still work the same way) but I added the two following functions in the catalog.rs file: ```rust pub fn upsert_for_ipnet( &mut self, ipnet: IpNet, name: LowerName, authority: Box<dyn AuthorityObject>, ) pub fn remove_for_ipnet( &mut self, ipnet: &IpNet, name: &LowerName, ) -> Option<Box<dyn AuthorityObject>> ``` Now, authorities are stored like this: ```rust authorities: vec![(None, HashMap::new())], ``` There is a small performance overhead when adding an AuthorityObject because the vector has to be sorted to have at the first position the smallest IpNet and last position the biggest one (which is None, corresponding to all networks and to the current behaviour, all networks). If this is not a wanted behavior or functionnalty feel free to delete this, I won't be offended it was just something I needed :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:06:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#2745
No description provided.