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:
14
nodes.go
14
nodes.go
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user