From af1f1d3ada857d2e9f9ecd40a6f50c6a49b7c0d3 Mon Sep 17 00:00:00 2001 From: Andreas Linde <42185+DerAndereAndi@users.noreply.github.com> Date: Thu, 23 Jun 2022 12:20:32 +0200 Subject: [PATCH] Fix compatibility with some IoT devices using avahi 0.8-rc1 (#27) * Fix compatibility with avahi 0.8-rc1 This fixes browse, lookup and also register not working properly with devices running with avahi 0.8-rc1 * Fix linter warning * Also set IPv6 HopLimit --- connection.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/connection.go b/connection.go index 598dbb99..a0936d9e 100644 --- a/connection.go +++ b/connection.go @@ -62,6 +62,8 @@ func joinUdp6Multicast(interfaces []net.Interface) (*ipv6.PacketConn, error) { return nil, fmt.Errorf("udp6: failed to join any of these interfaces: %v", interfaces) } + _ = pkConn.SetMulticastHopLimit(255) + return pkConn, nil } @@ -93,6 +95,8 @@ func joinUdp4Multicast(interfaces []net.Interface) (*ipv4.PacketConn, error) { return nil, fmt.Errorf("udp4: failed to join any of these interfaces: %v", interfaces) } + _ = pkConn.SetMulticastTTL(255) + return pkConn, nil }