dns_server: fix max ttl reply issue.
This commit is contained in:
@@ -2239,12 +2239,14 @@ static int _dns_client_process_udp_proxy(struct dns_server_info *server_info, st
|
||||
}
|
||||
|
||||
int latency = get_tick_count() - server_info->send_tick;
|
||||
tlog(TLOG_DEBUG, "recv udp packet from %s, len: %d, latency: %d",
|
||||
get_host_by_addr(from_host, sizeof(from_host), (struct sockaddr *)&from), len, latency);
|
||||
|
||||
if (latency < server_info->drop_packet_latency_ms) {
|
||||
tlog(TLOG_DEBUG, "drop packet from %s, latency: %d", from_host, latency);
|
||||
return 0;
|
||||
}
|
||||
|
||||
tlog(TLOG_DEBUG, "recv udp packet from %s, len: %d",
|
||||
get_host_by_addr(from_host, sizeof(from_host), (struct sockaddr *)&from), len);
|
||||
|
||||
/* update recv time */
|
||||
time(&server_info->last_recv);
|
||||
@@ -2322,14 +2324,15 @@ static int _dns_client_process_udp(struct dns_server_info *server_info, struct e
|
||||
}
|
||||
}
|
||||
|
||||
tlog(TLOG_DEBUG, "recv udp packet from %s, len: %d, ttl: %d",
|
||||
get_host_by_addr(from_host, sizeof(from_host), (struct sockaddr *)&from), len, ttl);
|
||||
int latency = get_tick_count() - server_info->send_tick;
|
||||
tlog(TLOG_DEBUG, "recv udp packet from %s, len: %d, ttl: %d, latency: %d",
|
||||
get_host_by_addr(from_host, sizeof(from_host), (struct sockaddr *)&from), len, ttl, latency);
|
||||
|
||||
/* update recv time */
|
||||
time(&server_info->last_recv);
|
||||
|
||||
int latency = get_tick_count() - server_info->send_tick;
|
||||
if (latency < server_info->drop_packet_latency_ms) {
|
||||
tlog(TLOG_DEBUG, "drop packet from %s, latency: %d", from_host, latency);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user