Update dns_spoof.go

This commit is contained in:
buffermet 2020-03-05 08:39:07 +10:00 committed by GitHub
commit 466105a1af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,11 +142,11 @@ func (mod *DNSSpoofer) Configure() error {
mod.Session.Firewall.EnableForwarding(true)
}
ttl_, err := strconv.ParseUint(ttl, 10, 32)
if err != nil {
return fmt.Errorf("dns.spoof.ttl value must be an integer")
_ttl, _ := strconv.ParseUint(ttl, 10, 32)
if _ttl <= 0 {
return fmt.Errorf("dns.spoof.ttl value must be 1 or higher")
}
mod.TTL = uint32(ttl_)
mod.TTL = uint32(_ttl)
return nil
}