mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -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
|
@ -81,7 +81,7 @@ func (s *EventsStream) dumpEvent(e session.Event) {
|
||||||
if e.Tag == "sys.log" {
|
if e.Tag == "sys.log" {
|
||||||
fmt.Printf("[%s] [%s] (%s) %s\n", tm, core.Green(e.Tag), e.Label(), e.Data.(session.LogMessage).Message)
|
fmt.Printf("[%s] [%s] (%s) %s\n", tm, core.Green(e.Tag), e.Label(), e.Data.(session.LogMessage).Message)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("[%s] [%s] %v\n", tm, core.Green(e.Tag), e)
|
fmt.Printf("[%s] [%s] %+v\n", tm, core.Green(e.Tag), e)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Session.Refresh()
|
s.Session.Refresh()
|
||||||
|
|
|
@ -126,7 +126,12 @@ func (d *Discovery) Show(by string) error {
|
||||||
sort.Sort(ByAddressSorter(targets))
|
sort.Sort(ByAddressSorter(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...)
|
targets = append([]*net.Endpoint{d.Session.Interface, d.Session.Gateway}, targets...)
|
||||||
|
}
|
||||||
|
|
||||||
rows := make([][]string, 0)
|
rows := make([][]string, 0)
|
||||||
for i, t := range targets {
|
for i, t := range targets {
|
||||||
rows = append(rows, d.getRow(t))
|
rows = append(rows, d.getRow(t))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue