Support TTL range value, optimize some logs

This commit is contained in:
Nick Peng
2019-01-11 21:34:15 +08:00
parent 1674c3d8c9
commit 4028887167
3 changed files with 31 additions and 14 deletions

View File

@@ -92,7 +92,7 @@ int config_server(int argc, char *argv[], dns_server_type_t type, int default_po
}
ttl = atoi(optarg);
if (ttl < 0 || ttl > 255) {
if (ttl < -255 || ttl > 255) {
tlog(TLOG_ERROR, "ttl value is invalid.");
return -1;
}