mirror of
https://github.com/bettercap/bettercap
synced 2025-07-14 00:53:46 -07:00
new: centralized logging and implemented DELETE /api/events route, closes #5
This commit is contained in:
parent
269d7d845b
commit
f1f146d3d7
21 changed files with 144 additions and 184 deletions
|
@ -76,18 +76,15 @@ func FindGateway(iface *Endpoint) (*Endpoint, error) {
|
|||
|
||||
if ifname == iface.Name() && flags == "UG" {
|
||||
gateway := m[2]
|
||||
// log.Debugf("Gateway ip is %s", gateway)
|
||||
if gateway == iface.IpAddress {
|
||||
// log.Debug("Gateway == Interface")
|
||||
return iface, nil
|
||||
} else {
|
||||
// we have the address, now we need its mac
|
||||
mac, err := ArpLookup(iface.Name(), gateway, false)
|
||||
if err == nil {
|
||||
// log.Debugf("Gateway mac is %s", mac)
|
||||
return NewEndpoint(gateway, mac), nil
|
||||
} else {
|
||||
log.Error(err)
|
||||
fmt.Printf("%s\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue