mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: fixed and refactored network.FindInterface because it was shit
This commit is contained in:
parent
9ee43b6b67
commit
f0158342d6
2 changed files with 94 additions and 78 deletions
|
@ -87,6 +87,15 @@ func NewEndpointWithAlias(ip, mac, alias string) *Endpoint {
|
|||
return e
|
||||
}
|
||||
|
||||
func (t *Endpoint) SetIP(ip string) {
|
||||
|
||||
addr := net.ParseIP(ip)
|
||||
|
||||
t.IP = addr
|
||||
t.IpAddress = ip
|
||||
t.IpAddressUint32 = ip2int(addr)
|
||||
}
|
||||
|
||||
func (t *Endpoint) Name() string {
|
||||
return t.Hostname
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue