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

Respond to multiple names #38

Open
davidgraeff opened this issue Apr 1, 2021 · 1 comment · May be fixed by #39 or #40
Open

Respond to multiple names #38

davidgraeff opened this issue Apr 1, 2021 · 1 comment · May be fixed by #39 or #40

Comments

@davidgraeff
Copy link

davidgraeff commented Apr 1, 2021

With limited amount of changes it would be possible to respond to more than just one name request. As far as I understood RFC 4795 it is also not forbidden for a single IP to be represented by multiple names.

The scenario I'm thinking of is, that a system has a generic name, ie "my-device.local" and a specific name "my-device-some-serial-number.local". This works with mdns, but not with this llmnr implementation.

The "--hostname" / "-H" parameter could be given multiple times.

Implementation idea:

If compiled with N=1 which matches current behaviour, there is only a little run-time overhead in llmnr_name_matches when the loop counter variable is evaluated.

WDYT?

If the idea sounds right to you, I could make a first draft MR.

@tklauser
Copy link
Owner

tklauser commented Apr 1, 2021

With limited amount of changes it would be possible to respond to more than just one name request. As far as I understood RFC 4795 it is also not forbidden for a single IP to be represented by multiple names.

That's my reading of RFC 4795 as well. I didn't have the need for multiple names so far, but it sounds like this would be a useful feature for llmnrd.

The scenario I'm thinking of is, that a system has a generic name, ie "my-device.local" and a specific name "my-device-some-serial-number.local". This works with mdns, but not with this llmnr implementation.

The "--hostname" / "-H" parameter could be given multiple times.

Implementation idea:

I think we could even dynamically allocate buffers depending on the arguments given instead of restricting the number of names to an arbitrary number N at compile time. I'd probably keep the buffers separate from llmnr_hostname.

  • llmnr_set_hostname would always change the first entry.

Given the dynamically allocated buffer is feasible, I think we wouldn't need to change llmnr_set_hostname at all.

If compiled with N=1 which matches current behaviour, there is only a little run-time overhead in llmnr_name_matches when the loop counter variable is evaluated.

Sounds acceptable to me. If we go for the separate buffers, there would even be less overhead if there are no additional names.

WDYT?

If the idea sounds right to you, I could make a first draft MR.

Sounds good to me in general. Please feel free to send a PR and we can further iterate on that. Thanks!

@davidgraeff davidgraeff linked a pull request Apr 6, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants