refactor codebase and fix bugs

- merge dante.go and dante_control.go into single dante.go
- consolidate buildDantePacket and buildDantePacket28 into one function
- fix broken comparison logic in SetDanteClockMaster
- split ARP parsing into platform-specific files with build tags
- implement Linux ARP table parsing via /proc/net/arp
- run gofmt on all files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-23 23:21:51 -08:00
parent f4b2351de8
commit 7e8ec697ae
10 changed files with 888 additions and 877 deletions

View File

@@ -637,19 +637,7 @@ func (n *Nodes) UpdateMACTable(node *Node, peerMAC net.HardwareAddr, ifaceName s
}
func (n *Nodes) SetDanteClockMaster(ip net.IP) {
n.mu.RLock()
currentMaster := ""
for _, node := range n.nodes {
if node.IsDanteClockMaster {
currentMaster = ip.String()
break
}
}
n.mu.RUnlock()
if currentMaster != ip.String() {
n.Update(nil, nil, []net.IP{ip}, "", "", "ptp")
}
n.Update(nil, nil, []net.IP{ip}, "", "", "ptp")
n.mu.Lock()
defer n.mu.Unlock()