fix(snmp,db): save FDB to PG (empty inet null), bridge_port + MAC normalize
Made-with: Cursor
This commit is contained in:
@@ -119,11 +119,12 @@ type InterfaceResult struct {
|
||||
|
||||
// PortDeviceResult — MAC/IP, обнаруженные за конкретным портом (ifIndex) через BRIDGE-MIB + ARP.
|
||||
type PortDeviceResult struct {
|
||||
IP string `json:"ip"`
|
||||
IfIndex int `json:"if_index"`
|
||||
MAC string `json:"mac"`
|
||||
LearnedIP string `json:"learned_ip"`
|
||||
CheckedAt time.Time `json:"checked_at"`
|
||||
IP string `json:"ip"`
|
||||
IfIndex int `json:"if_index"`
|
||||
BridgePort int `json:"bridge_port,omitempty"`
|
||||
MAC string `json:"mac"`
|
||||
LearnedIP string `json:"learned_ip"`
|
||||
CheckedAt time.Time `json:"checked_at"`
|
||||
}
|
||||
|
||||
type MemoryStore struct {
|
||||
@@ -409,7 +410,7 @@ func (s *MemoryStore) ListPortDeviceResults(scanID string, filterIP string, filt
|
||||
if filterIP != "" && r.IP != filterIP {
|
||||
continue
|
||||
}
|
||||
if filterIfIndex > 0 && r.IfIndex != filterIfIndex {
|
||||
if filterIfIndex > 0 && r.IfIndex != filterIfIndex && r.BridgePort != filterIfIndex {
|
||||
continue
|
||||
}
|
||||
filtered = append(filtered, r)
|
||||
|
||||
Reference in New Issue
Block a user