From 1d6075d395992c4731fceb740e06ab71699eb748 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sun, 25 Jan 2026 11:52:28 -0800 Subject: [PATCH] Add mDNS support for _netaudio-chan service with channel@device format --- mdns.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mdns.go b/mdns.go index 915baa6..47c1499 100644 --- a/mdns.go +++ b/mdns.go @@ -27,7 +27,7 @@ func extractSkaarhojName(s string) string { } func isNetaudioService(s string) bool { - return strings.Contains(s, "_netaudio-cmc._udp") || strings.Contains(s, "_netaudio-arc._udp") + return strings.Contains(s, "_netaudio-cmc._udp") || strings.Contains(s, "_netaudio-arc._udp") || strings.Contains(s, "_netaudio-chan._udp") } func extractNetaudioName(s string) string { @@ -40,6 +40,18 @@ func extractNetaudioName(s string) string { return "" } +func extractNetaudioChanDevice(s string) string { + idx := strings.Index(s, "._netaudio-chan._udp") + if idx <= 0 { + return "" + } + name := strings.ReplaceAll(s[:idx], "\\", "") + if atIdx := strings.Index(name, "@"); atIdx >= 0 { + return name[atIdx+1:] + } + return "" +} + func (t *Tendrils) listenMDNS(ctx context.Context, iface net.Interface) { addr, err := net.ResolveUDPAddr("udp4", mdnsAddr) if err != nil { @@ -129,6 +141,9 @@ func (t *Tendrils) processMDNSResponse(ifaceName string, srcIP net.IP, msg *dns. } if isNetaudioService(r.Hdr.Name) { name := extractNetaudioName(r.Hdr.Name) + if name == "" { + name = extractNetaudioChanDevice(r.Hdr.Name) + } if name != "" { netaudioNames[name] = true if target != "" { @@ -195,6 +210,7 @@ var mdnsServices = []string{ "_hyperdeck_ctrl._tcp.local.", "_netaudio-cmc._udp.local.", "_netaudio-arc._udp.local.", + "_netaudio-chan._udp.local.", } func (t *Tendrils) runMDNSQuerier(ctx context.Context, iface net.Interface, conn *net.UDPConn) {