1
0
Fork 0
mirror of https://github.com/yarrick/iodine.git synced 2025-04-04 13:53:34 +03:00

Rename nameserv_addrs_len to nameserv_addrs_count

This commit is contained in:
Frank Denis 2016-11-04 16:53:10 +01:00
parent dbe9a10fc1
commit 756dc2005d
3 changed files with 6 additions and 6 deletions

View file

@ -135,7 +135,7 @@ void
client_rotate_nameserver()
{
this.current_nameserver ++;
if (this.current_nameserver >= this.nameserv_addrs_len)
if (this.current_nameserver >= this.nameserv_addrs_count)
this.current_nameserver = 0;
}

View file

@ -38,7 +38,7 @@ struct client_instance {
char **nameserv_hosts;
size_t nameserv_hosts_len;
struct sockaddr_storage *nameserv_addrs;
size_t nameserv_addrs_len;
size_t nameserv_addrs_count;
int current_nameserver;
struct sockaddr_storage raw_serv;
int raw_serv_len;

View file

@ -645,11 +645,11 @@ main(int argc, char **argv)
nameserv_host, gai_strerror(nameservaddr_len));
}
memcpy(&this.nameserv_addrs[n], &nameservaddr, sizeof(struct sockaddr_storage));
this.nameserv_addrs_len ++;
this.nameserv_addrs_count ++;
nameserv_host = NULL;
}
if (this.nameserv_addrs_len <= 0 || !this.nameserv_hosts[0]) {
if (this.nameserv_addrs_count <= 0 || !this.nameserv_hosts[0]) {
warnx("No nameservers found - not connected to any network?");
usage();
}
@ -732,9 +732,9 @@ main(int argc, char **argv)
signal(SIGTERM, sighandler);
fprintf(stderr, "Sending DNS queries for %s to ", this.topdomain);
for (int a = 0; a < this.nameserv_addrs_len; a++)
for (int a = 0; a < this.nameserv_addrs_count; a++)
fprintf(stderr, "%s%s", format_addr(&this.nameserv_addrs[a], sizeof(struct sockaddr_storage)),
(a != this.nameserv_addrs_len - 1) ? ", " : "");
(a != this.nameserv_addrs_count - 1) ? ", " : "");
fprintf(stderr, "\n");
if (this.remote_forward_addr.ss_family != AF_UNSPEC)