misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-02-17 06:04:16 +01:00
commit eb5a72a44c
9 changed files with 234 additions and 220 deletions

View file

@ -154,7 +154,7 @@ func (s *DHCP6Spoofer) dhcpAdvertise(pkt gopacket.Packet, solicit dhcp6.Packet,
}
var ip net.IP
if t, found := s.Session.Targets.Targets[target.String()]; found == true {
if t, found := s.Session.Lan.Hosts[target.String()]; found == true {
ip = t.IP
} else {
log.Warning("Address %s not known, using random identity association address.", target.String())
@ -312,7 +312,7 @@ func (s *DHCP6Spoofer) dhcpReply(toType string, pkt gopacket.Packet, req dhcp6.P
addr = net.IP(raw[0])
}
if t, found := s.Session.Targets.Targets[target.String()]; found == true {
if t, found := s.Session.Lan.Hosts[target.String()]; found == true {
log.Info("[%s] IPv6 address %s is now assigned to %s", core.Green("dhcp6"), addr.String(), t)
} else {
log.Info("[%s] IPv6 address %s is now assigned to %s", core.Green("dhcp6"), addr.String(), target)