Skip to content

Return notfound when lookup for the unhandled AF is tried - #101

Open
pemensik wants to merge 1 commit into
avahi:masterfrom
pemensik:master-100-not-found
Open

Return notfound when lookup for the unhandled AF is tried#101
pemensik wants to merge 1 commit into
avahi:masterfrom
pemensik:master-100-not-found

Conversation

@pemensik

Copy link
Copy Markdown
Member

Fixes #100

@pemensik
pemensik force-pushed the master-100-not-found branch from 1ac4b6d to 1bafe40 Compare November 19, 2025 18:33
@evverx

evverx commented Nov 19, 2025

Copy link
Copy Markdown
Collaborator

I'm not sure how safe it is to make backward incompatible changes like this but if you are convinced that it's warranted (as opposed to, say, keeping that stuff intact, documenting the pitfalls and introducing new modules instead) I think the commit message should be more specific. I don't think "Fixes #100" is descriptive enough. It should probably say what exactly it fixes, why it does that and why the breaking change is warranted in general. Tests would be nice too.

Changes return code for mdns4_minimal and mdns6_minimal, when request is
done for the other address family. It behaves like that host is never
found. That makes plugin to not continue to dns lookup only for single
address family.

It expects user would have return on not found. Just like is suggested
in README.me

/etc/nsswitch is expected to have:
hosts: files mdns4_minimal [NOTFOUND=return] dns

This change will stop resolving all AF_INET6 on mdns4_minimal.

Because there is no configration file used for minimal variants, it does
not have any way to return previous behaviour. It is expected new
behaviour would be considered better by everyone.

Fixes avahi#100
@pemensik
pemensik force-pushed the master-100-not-found branch from 1bafe40 to ed3155a Compare November 30, 2025 18:06
@pemensik

Copy link
Copy Markdown
Member Author

Hmm, when tried it on my host, it seems it returns ipv6 mapped ipv4 address to getent ahostsv6 <hostname>. Therefore it should stop ipv6 lookups.

@evverx

evverx commented Nov 30, 2025

Copy link
Copy Markdown
Collaborator

I didn't mean manual tests. If you are planning to enforce some sort of policy where IPv6 lookups can't get past the nss-mdns modules it should come with actual tests making sure that it actually works (and keeps working). It should be possible to bring the actual CI from avahi/avahi#768 and test all those things.

Other than that I'm not sure why backward incompatible changes are needed. Why can't UNAVAIL=return be added to get it around? Why aren't possible leaks to DNS resolvers mentioned in the commit message?

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.

mdns4_minimal lets later DNS module handle IPv6

2 participants