mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
9f83d66f99
commit
20f92a68e0
2 changed files with 4 additions and 6 deletions
|
@ -97,17 +97,15 @@ func (t *Endpoint) SetNetwork(netw string) {
|
||||||
t.SetBits(uint32(bits))
|
t.SetBits(uint32(bits))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Endpoint) SetIPv6Network(netw string) {
|
func (t *Endpoint) SetIPv6(netw string) {
|
||||||
parts := strings.SplitN(netw, "/", 2)
|
parts := strings.SplitN(netw, "/", 2)
|
||||||
address := parts[0]
|
address := parts[0]
|
||||||
bits, _ := strconv.Atoi(parts[1])
|
// bits, _ := strconv.Atoi(parts[1])
|
||||||
|
|
||||||
t.IPv6 = net.ParseIP(address)
|
t.IPv6 = net.ParseIP(address)
|
||||||
if t.IPv6 != nil {
|
if t.IPv6 != nil {
|
||||||
t.Ip6Address = t.IPv6.String()
|
t.Ip6Address = t.IPv6.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
t.SetBits(uint32(bits))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Endpoint) SetIP(ip string) {
|
func (t *Endpoint) SetIP(ip string) {
|
||||||
|
|
|
@ -63,8 +63,8 @@ func buildEndpointFromInterface(iface net.Interface) (*Endpoint, error) {
|
||||||
e.SetNetwork(address)
|
e.SetNetwork(address)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// ipv6/bits
|
// ipv6/xxx
|
||||||
e.SetIPv6Network(address)
|
e.SetIPv6(address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue