troglobit / mdnsd

Jeremie Miller's original mdnsd
BSD 3-Clause "New" or "Revised" License
55 stars 35 forks source link

Added conflict handling for hostname. #39

Closed P-Fleer closed 4 years ago

P-Fleer commented 4 years ago

If the host name already exists on the local network, a suffix is appended to the name.

troglobit commented 4 years ago

This looks in general really good! What do you think about adding three last octets of MAC address instead to hostname in conflict resolution?

I dunno if that's even included, but you've got it in your L1 cache right now and that's what we do at $DAYJOB currently with the Apple mDNSResponder.

P-Fleer commented 4 years ago

Hi Joachim,

sorry I'm late in answering. The reason why I append an index to the hostname is that the avahi-deamon behaves the same way. It would also be possible to append the last three octets of the MAC address. In our case this would be difficult because our devices have 2 or 3 MAC addresses (Ethernet, Powerline, WiFi). By default we will append the last 3 digits of the serial number. The conflict handling usually only becomes active if the customer assigns the same name on several devices.

Best regards Peter


Von: Joachim Nilsson notifications@github.com Gesendet: Montag, 25. Mai 2020 17:58 An: troglobit/mdnsd mdnsd@noreply.github.com Cc: Peter Fleer Peter.Fleer@devolo.de; Author author@noreply.github.com Betreff: Re: [troglobit/mdnsd] Added conflict handling for hostname. (#39)

This looks in general really good! What do you think about adding three last octets of MAC address instead to hostname in conflict resolution?

I dunno if that's even included, but you've got it in your L1 cache right now and that's what we do at $DAYJOB currently with the Apple mDNSResponder.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/troglobit/mdnsd/pull/39#issuecomment-633633676, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOPEI5CZBEEAF227XYBPCDLRTKITJANCNFSM4NJCNIEA.

troglobit commented 4 years ago

Aha, that was interesting, did not know that about Avahi. Thanks!

We have a similar problem at Westermo, we have up to 32 MAC addresses per device. One per physical port. For a collection of ports (VLAN) one MAC us selected for that layer-3 interface which is used for management. This is what is announced by mDNS/SD: services reachable on that interface.

An index is OK, but hard to identify using the production label (serial no + base MAC) on the outside when opening a cabinet. The last three octets though: weos-34-56-78.local and weos-9a-bb-a0 are a lot easier to spot when you know the OUI.

Don't get me wrong, I like your patch. Just looking for a way to make it configurable. (And at the same time fit my use-case of course :-)

P-Fleer commented 4 years ago

We also have devices with Linux running the Avahi daemon. It has been requested that mDNS daemon behaves the same manner. For the customer, both devices should behave in the same way. This patch is just a suggestion to solve the problem. I had seen that the function mdnsd_conflict was still empty and a solution similar to ours was implemented. Unfortunately it is not configurable.


Von: Joachim Nilsson notifications@github.com Gesendet: Dienstag, 2. Juni 2020 01:03 An: troglobit/mdnsd mdnsd@noreply.github.com Cc: Peter Fleer Peter.Fleer@devolo.de; Author author@noreply.github.com Betreff: Re: [troglobit/mdnsd] Added conflict handling for hostname. (#39)

Aha, that was interesting, did not know that about Avahi. Thanks!

We have a similar problem at Westermo, we have up to 32 MAC addresses per device. One per physical port. For a collection of ports (VLAN) one MAC us selected for that layer-3 interface which is used for management. This is what is announced by mDNS/SD: services reachable on that interface.

An index is OK, but hard to identify using the production label (serial no + base MAC) on the outside when opening a cabinet. The last three octets though: weos-34-56-78.local and weos-9a-bb-a0 are a lot easier to spot when you know the OUI.

Don't get me wrong, I like your patch. Just looking for a way to make it configurable. (And at the same time fit my use-case of course :-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/troglobit/mdnsd/pull/39#issuecomment-637170708, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOPEI5AKR445JSUJQIKI6J3RUQXUZANCNFSM4NJCNIEA.

troglobit commented 4 years ago

I understand completely! :)

I've just been dragging my feet merging this PR, sorry. Simply wanted to check myself if it's possible to add my/our own use-case. Let's put it like this; I'll add a TODO to support using MAC suffix for conflict resulution in the future, if so you may have to set this up in the configuration somehow to get your behavior. Is that OK?