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

Avoid replicating mDNS messages received on docker0 #43

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

agners
Copy link
Member

@agners agners commented Feb 21, 2022

Currently mdns-repeater replicates all messages received except those
which have the source address of one of the specified interfaces.

When running a service on host network, and that service announces its
addresses on all interfaces via mDNS. Typically, the IN A records
announced on each interface is the address of that interface (e.g.
Apple's mDNSResponder reference implementation behaves that way,
used by OTBR).

Adding docker0 makes sure that docker0 is in the list of interfaces to
replicate to, which makes sure that interfaces from that address are
considered local and not replicated.

Currently mdns-repeater replicates all messages received except those
which have the source address of one of the specified interfaces.

When running a service on host network, and that service announces its
addresses on all interfaces via mDNS. Typically, the IN A records
announced on each interface is the address of that interface (e.g.
Apple's mDNSResponder reference implementation behaves that way,
used by OTBR).

Adding docker0 makes sure that docker0 is in the list of interfaces to
replicate to, which makes sure that interfaces from that address are
considered local and not replicated.
@agners
Copy link
Member Author

agners commented Feb 21, 2022

This causes 172.17.0.1 being announced on the main network (eth0), which makes the service announced not accessible from other hosts
image

When adding a debug print with self_generated_packet, it shows that the package is indeed replicated by mdns-repeater:

mdns-repeater (7): data from=172.30.32.1 size=143, self_generated_packet=1
mdns-repeater (7): data from=172.17.0.1 size=143, self_generated_packet=0         
mdns-repeater (7): repeating data to eth0
mdns-repeater (7): repeating data to hassio

@agners agners requested a review from pvizeli February 21, 2022 09:23
@pvizeli pvizeli merged commit 5b3edc0 into master Feb 21, 2022
@pvizeli pvizeli deleted the fix-replicating-mdns-messages-from-docker0 branch February 21, 2022 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants