Skip to content

Commit

Permalink
it was not using the last DNS server from the DNS servers list, X % N…
Browse files Browse the repository at this point in the history
… results [0, N)
  • Loading branch information
ehrhardt committed Mar 22, 2017
1 parent 998c089 commit e0e232b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dns_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void tcp_query(void *query, response *buffer, int len) {
srand(time(NULL));

// select random dns server
in_addr_t remote_dns = inet_addr(dns_servers[rand() % (NUM_DNS - 1)]);
in_addr_t remote_dns = inet_addr(dns_servers[rand() % NUM_DNS]);
memcpy(tmp, "\x05\x01\x00\x01", 4);
memcpy(tmp + 4, &remote_dns, 4);
memcpy(tmp + 8, "\x00\x35", 2);
Expand Down

0 comments on commit e0e232b

Please sign in to comment.