mirror of
https://github.com/yarrick/iodine.git
synced 2024-12-01 10:56:33 +00:00
name the address of the nameserver nameserv instead of peer
This commit is contained in:
parent
1965b0af32
commit
060c2e3faa
12
src/iodine.c
12
src/iodine.c
|
@ -53,7 +53,7 @@ static int build_hostname(char *buf, size_t buflen,
|
||||||
static int running = 1;
|
static int running = 1;
|
||||||
static char password[33];
|
static char password[33];
|
||||||
|
|
||||||
static struct sockaddr_in peer;
|
static struct sockaddr_in nameserv;
|
||||||
static char *topdomain;
|
static char *topdomain;
|
||||||
|
|
||||||
static uint16_t rand_seed;
|
static uint16_t rand_seed;
|
||||||
|
@ -95,7 +95,7 @@ send_query(int fd, char *hostname)
|
||||||
|
|
||||||
len = dns_encode(packet, sizeof(packet), &q, QR_QUERY, hostname, strlen(hostname));
|
len = dns_encode(packet, sizeof(packet), &q, QR_QUERY, hostname, strlen(hostname));
|
||||||
|
|
||||||
sendto(fd, packet, len, 0, (struct sockaddr*)&peer, sizeof(peer));
|
sendto(fd, packet, len, 0, (struct sockaddr*)&nameserv, sizeof(nameserv));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -564,10 +564,10 @@ set_nameserver(const char *cp)
|
||||||
if (inet_aton(cp, &addr) != 1)
|
if (inet_aton(cp, &addr) != 1)
|
||||||
errx(1, "error parsing nameserver address: '%s'", cp);
|
errx(1, "error parsing nameserver address: '%s'", cp);
|
||||||
|
|
||||||
memset(&peer, 0, sizeof(peer));
|
memset(&nameserv, 0, sizeof(nameserv));
|
||||||
peer.sin_family = AF_INET;
|
nameserv.sin_family = AF_INET;
|
||||||
peer.sin_port = htons(53);
|
nameserv.sin_port = htons(53);
|
||||||
peer.sin_addr = addr;
|
nameserv.sin_addr = addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue