Skip to content

Commit

Permalink
get info on all interfaces except loopback, send probes on all interf…
Browse files Browse the repository at this point in the history
…aces except loopback and bond slaves (#34)
  • Loading branch information
edcdavid authored Mar 29, 2023
1 parent d2f0040 commit fa1679e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions l2discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fa1679e

Please sign in to comment.