mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 05:23:19 -07:00
fix: dont' show interface twice if it is the gateway
This commit is contained in:
parent
530ac53abd
commit
6bd88bc7e3
2 changed files with 7 additions and 2 deletions
|
@ -126,7 +126,12 @@ func (d *Discovery) Show(by string) error {
|
|||
sort.Sort(ByAddressSorter(targets))
|
||||
}
|
||||
|
||||
targets = append([]*net.Endpoint{d.Session.Interface, d.Session.Gateway}, targets...)
|
||||
if d.Session.Interface.HwAddress == d.Session.Gateway.HwAddress {
|
||||
targets = append([]*net.Endpoint{d.Session.Interface}, targets...)
|
||||
} else {
|
||||
targets = append([]*net.Endpoint{d.Session.Interface, d.Session.Gateway}, targets...)
|
||||
}
|
||||
|
||||
rows := make([][]string, 0)
|
||||
for i, t := range targets {
|
||||
rows = append(rows, d.getRow(t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue