Skip to content

Commit

Permalink
dns_server: fix ttl issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Feb 17, 2023
1 parent a62d716 commit d2d7dac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dns_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ static int _dns_server_get_conf_ttl(struct dns_request *request, int ttl)
return rr_ttl;
}

if (rr_ttl_min > 0 && ttl > rr_ttl_min) {
ttl = rr_ttl_min;
} else if (rr_ttl_max > 0 && ttl < rr_ttl_max) {
if (rr_ttl_max > 0 && ttl > rr_ttl_max) {
ttl = rr_ttl_max;
} else if (rr_ttl_min > 0 && ttl < rr_ttl_min) {
ttl = rr_ttl_min;
}

return ttl;
Expand Down

0 comments on commit d2d7dac

Please sign in to comment.