Skip to content

Commit

Permalink
Fix compatibility with some IoT devices using avahi 0.8-rc1 (grandcat#27
Browse files Browse the repository at this point in the history
)

* 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
  • Loading branch information
DerAndereAndi committed Jun 23, 2022
1 parent 5b2a13d commit af1f1d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit af1f1d3

Please sign in to comment.