Skip to content

Fix parsing of /etc/resolv.conf by manually updating resolv-conf crate#184

Merged
imsnif merged 2 commits intoimsnif:mainfrom
Ma27:dns-init-fix
Sep 11, 2020
Merged

Fix parsing of /etc/resolv.conf by manually updating resolv-conf crate#184
imsnif merged 2 commits intoimsnif:mainfrom
Ma27:dns-init-fix

Conversation

@Ma27
Copy link
Copy Markdown
Contributor

@Ma27 Ma27 commented Sep 11, 2020

Ma27 added a commit to NixOS/nixpkgs that referenced this pull request Sep 11, 2020
ChangeLogs:

* https://github.com/imsnif/bandwhich/releases/tag/0.18.1
* https://github.com/imsnif/bandwhich/releases/tag/0.18.0

Also applied a fix[1] for rDNS support which broke with `systemd-v246`
because the `resolv-conf` crate didn't support the `options
trust_ad`-declaration in systemd's `/etc/resolv.conf`[2].

[1] imsnif/bandwhich#184
[2] imsnif/bandwhich#166 (comment)
Ma27 added a commit to NixOS/nixpkgs that referenced this pull request Sep 11, 2020
ChangeLogs:

* https://github.com/imsnif/bandwhich/releases/tag/0.18.1
* https://github.com/imsnif/bandwhich/releases/tag/0.18.0

Also applied a fix[1] for rDNS support which broke with `systemd-v246`
because the `resolv-conf` crate didn't support the `options
trust_ad`-declaration in systemd's `/etc/resolv.conf`[2].

[1] imsnif/bandwhich#184
[2] imsnif/bandwhich#166 (comment)

(cherry picked from commit 8149ab1)
Copy link
Copy Markdown
Owner

@imsnif imsnif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, interesting! Thanks for finding this and issuing the fix. I'll keep an eye on resolv-conf to see when they release a new version. I take it this solves the problem for you?

Also, could you run rustfmt so that the build passes?

src/os/shared.rs Outdated
let resolver = match runtime.block_on(dns::Resolver::new(runtime.handle().clone())) {
Ok(resolver) => resolver,
Err(_) => failure::bail!("Could not initialize the DNS resolver. Are you offline?"),
Err(err) => failure::bail!("Could not initialize the DNS resolver. Are you offline?\n\nReason: {:?}", err),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

This fixes the parsing of `/etc/resolv.conf` with `options trust-ad`
which is e.g. used in `systemd-resolved-v246`[1].

Refs imsnif#166

[1] systemd/systemd@a742f98
@Ma27
Copy link
Copy Markdown
Contributor Author

Ma27 commented Sep 11, 2020

Also, could you run rustfmt so that the build passes?

Done.

I take it this solves the problem for you?

Yes.

@imsnif imsnif merged commit 52f758d into imsnif:main Sep 11, 2020
@Ma27 Ma27 deleted the dns-init-fix branch September 11, 2020 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants