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