Skip to content

Commit 83c0f25

Browse files
authored
Implement new glibc options no-reload and trust-ad (#22)
1 parent c92ff90 commit 83c0f25

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/config.rs

+12
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ pub struct Config {
9494
pub no_tld_query: bool,
9595
/// Force using TCP for DNS resolution
9696
pub use_vc: bool,
97+
/// Disable the automatic reloading of a changed configuration file
98+
pub no_reload: bool,
99+
/// Optionally send the AD (authenticated data) bit in queries
100+
pub trust_ad: bool,
97101
/// The order in which databases should be searched during a lookup
98102
/// **(openbsd-only)**
99103
pub lookup: Vec<Lookup>,
@@ -150,6 +154,8 @@ impl Config {
150154
single_request_reopen: false,
151155
no_tld_query: false,
152156
use_vc: false,
157+
no_reload: false,
158+
trust_ad: false,
153159
lookup: Vec::new(),
154160
family: Vec::new(),
155161
}
@@ -370,6 +376,12 @@ impl fmt::Display for Config {
370376
if self.use_vc {
371377
writeln!(fmt, "options use-vc")?;
372378
}
379+
if self.no_reload {
380+
writeln!(fmt, "options no-reload")?;
381+
}
382+
if self.trust_ad {
383+
writeln!(fmt, "options trust-ad")?;
384+
}
373385

374386
Ok(())
375387
}

src/grammar.rs

+2
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ pub(crate) fn parse(bytes: &[u8]) -> Result<Config, ParseError> {
198198
("edns0", _) => cfg.edns0 = true,
199199
("single-request", _) => cfg.single_request = true,
200200
("single-request-reopen", _) => cfg.single_request_reopen = true,
201+
("no-reload", _) => cfg.no_reload = true,
202+
("trust-ad", _) => cfg.trust_ad = true,
201203
("no-tld-query", _) => cfg.no_tld_query = true,
202204
("use-vc", _) => cfg.use_vc = true,
203205
_ => return Err(InvalidOption(lineno)),

0 commit comments

Comments
 (0)