Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache /etc/mdns.allow information in the process #88

Open
pemensik opened this issue Aug 1, 2023 · 3 comments
Open

Cache /etc/mdns.allow information in the process #88

pemensik opened this issue Aug 1, 2023 · 3 comments

Comments

@pemensik
Copy link
Member

pemensik commented Aug 1, 2023

While writing a response to mdns or mdns_minimal question of Fedora devel list, I have realized nss-mdns is too naive when parsing /etc/mdns.allow configuration.

I think nss-dns plugin of glibc could be an inspiration for a well working basic caching of configuration. I think it does some smartness about /etc/resolv.conf parsing. We want to avoid unnecessary file reading on every query request, which current mdns? plugin variants does IMO. If we could cache missing file /etc/mdns.allow, we could use just single variant.

We could as well fetch list of domains to use from avahi-daemon itself and cache that. That way we could receive instructions how to handle IPv4 and IPv6 separately, which would allow to use just single mdns plugin instead of 6 separate plugins provided now.

@pemensik
Copy link
Member Author

pemensik commented Aug 1, 2023

An example how nss_dns caches /etc/resolv.conf information might be at __resolv_conf_get_current function of glibc. Part of res_ninit() call used in -lresolv library.

It would be better if we could find simpler version than this.

@pbrezina
Copy link

pbrezina commented Oct 9, 2024

Bump. Was there any progress?

@pemensik
Copy link
Member Author

pemensik commented Oct 9, 2024

No, there is no obvious way to store information in thread safe way between multiple resolutions. I were told glibc stub uses something special in dns plugin, which we cannot copy into mdns plugin. I have started thinking about a new API with existing context. It would allow keeping some information between resolutions, inside single thread. But this is not the best place for expanding such ideas.

I do not think current getaddrinfo() call or related calls provide any decent place to store cached information. It might be good to ask about this on Fedora devel, whether it can be solved a good way with what we have now.

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

No branches or pull requests

2 participants