From fa1679ede7f6099ea3e90339947f739ced4d5fbc Mon Sep 17 00:00:00 2001 From: David Elie-Dit-Cosaque <86730676+edcdavid@users.noreply.github.com> Date: Wed, 29 Mar 2023 16:25:14 -0500 Subject: [PATCH] get info on all interfaces except loopback, send probes on all interfaces except loopback and bond slaves (#34) --- l2discovery.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/l2discovery.go b/l2discovery.go index e09a1bb..7a84c3d 100644 --- a/l2discovery.go +++ b/l2discovery.go @@ -168,7 +168,9 @@ func main() { for _, iface := range macs { RecordAllLocal(iface) go RecvFrame(iface, macExist) - go sendProbeForever(iface) + if iface.IfSlaveType != bondSlave { + go sendProbeForever(iface) + } } go PrintLog() select {} @@ -323,9 +325,8 @@ func getIfs() (macs map[string]*exports.Iface, macsExist map[string]bool, err er return macs, macsExist, err } for _, aIfRaw := range aIPOut { - if !(aIfRaw.Linkinfo.InfoKind == "" && - aIfRaw.LinkType != "loopback" && - (aIfRaw.Linkinfo.InfoSlaveKind == bondSlave || aIfRaw.Linkinfo.InfoSlaveKind == "")) { + if aIfRaw.LinkType == "loopback" || + aIfRaw.Linkinfo.InfoKind != "" { continue } address, _ := getPci(aIfRaw.Ifname)