fix local address population and snmp reverse port discovery

populate root node with local macs/ips at startup, excluding loopback addresses and permanent arp entries. detect when snmp finds parent node mac in child forwarding table and set child localport.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2025-11-29 22:13:25 -08:00
parent 5db9e437b4
commit 75bbf4b0a4
4 changed files with 99 additions and 7 deletions

View File

@@ -122,14 +122,16 @@ func (n *Nodes) UpdateWithParent(parentIP net.IP, ips []net.IP, macs []net.Hardw
node := n.nodes[targetID]
var added []string
if node.LocalPort == "" && childPort != "" {
node.LocalPort = childPort
added = append(added, "localPort="+childPort)
}
if targetID != 0 {
if node.LocalPort == "" && childPort != "" {
node.LocalPort = childPort
added = append(added, "localPort="+childPort)
}
if node.ParentPort == "" && parentPort != "" {
node.ParentPort = parentPort
added = append(added, "parentPort="+parentPort)
if node.ParentPort == "" && parentPort != "" {
node.ParentPort = parentPort
added = append(added, "parentPort="+parentPort)
}
}
for _, ip := range ips {