Skip to content

Commit

Permalink
Only replacate mDNS towards hassio network (#44)
Browse files Browse the repository at this point in the history
So far, all interfaces have been specified. This replicates all
mDNS messages received on the hassio network interface towards the
outside interface, and all mDNS messages received on the external
interface towards hassio.

However, this does not work well in two cases:
- When an additional interface is present: mdns-repeater listens on
  any mDNS messages. If an additional interface is present, messages
  from that interface get replicated on the main Ethernet interface.
  This is problematic when there already exists a router which
  replicates the messages between the two networks.
- When multiple subnets are present on one interface: mdns-repeater
  matches the senders IP address with the interface IP/mask to determine
  if the mDNS message has been received from a particular interface.
  If multiple IPs are present, or mDNS messages originate for some other
  reason not from the same IP network as the local interface is
  configured for, mdns-repeater starts to replicate messages received on
  the same interface.

The last problem has been improved by also checking the received
interface (besides sender IP), which should avoid this type of
replication.

However, replicating mDNS messages from the internal hassio network to
the Ethernet is in almost all cases not helpful anyways: Typically mDNS
responder use the local interface address to generate mDNS A records.
The local address from an add-on attached ot the hassio network is not
helpful in the extenal network.

By only specifying the hassio network mdns-repeater will continue to
listen on all interfaces, but only replicate mDNS messages towards
hassio.
  • Loading branch information
agners authored Feb 23, 2022
1 parent 5b3edc0 commit 0d2ec64
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ codenotary:
signer: notary@home-assistant.io
base_image: notary@home-assistant.io
args:
MDNS_REPEATER_VERSION: 1.1.2
MDNS_REPEATER_VERSION: 1.2.0
labels:
io.hass.type: multicast
org.opencontainers.image.source: https://github.com/home-assistant/plugin-multicast
7 changes: 0 additions & 7 deletions rootfs/etc/cont-init.d/interface.sh

This file was deleted.

2 changes: 1 addition & 1 deletion rootfs/etc/services.d/mdns/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Start mDNS repeater service
# ==============================================================================

exec mdns-repeater -f ${ACTIVE_INTERFACE} hassio docker0
exec mdns-repeater -f hassio

0 comments on commit 0d2ec64

Please sign in to comment.