Use MulticastGroup as map key and serialize under lock

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-28 22:48:55 -08:00
parent 042ccab74e
commit aebd6f5e2c
4 changed files with 40 additions and 92 deletions

View File

@@ -103,10 +103,9 @@ func (n *Nodes) GetDanteTxDeviceInGroup(groupIP net.IP) *Node {
defer n.mu.RUnlock()
group := ParseMulticastGroup(groupIP)
groupKey := group.String()
for _, node := range n.nodes {
if node.DanteTxChannels != "" && node.MulticastGroups != nil {
if _, exists := node.MulticastGroups[groupKey]; exists {
if _, exists := node.MulticastGroups[group]; exists {
return node
}
}