mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-24 00:59:19 +02:00
#7 Actually update server_id
This commit is contained in:
parent
9ca4130e9a
commit
6fa0d98c99
|
@ -167,6 +167,10 @@ read_dns(int fd, char *buf, int buflen)
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = dns_decode(buf, buflen, &q, QR_ANSWER, data, r);
|
rv = dns_decode(buf, buflen, &q, QR_ANSWER, data, r);
|
||||||
|
|
||||||
|
if (rv > 0) {
|
||||||
|
server_id = q.id;
|
||||||
|
}
|
||||||
|
|
||||||
if (packet_empty(&packet) == 0 && chunkid == q.id) {
|
if (packet_empty(&packet) == 0 && chunkid == q.id) {
|
||||||
/* Got ACK on sent packet */
|
/* Got ACK on sent packet */
|
||||||
|
@ -214,7 +218,7 @@ tunnel_dns(int tun_fd, int dns_fd)
|
||||||
|
|
||||||
if ((read = read_dns(dns_fd, in, sizeof(in))) <= 0)
|
if ((read = read_dns(dns_fd, in, sizeof(in))) <= 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
outlen = sizeof(out);
|
outlen = sizeof(out);
|
||||||
inlen = read;
|
inlen = read;
|
||||||
if (uncompress((uint8_t*)out, &outlen, (uint8_t*)in, inlen) != Z_OK)
|
if (uncompress((uint8_t*)out, &outlen, (uint8_t*)in, inlen) != Z_OK)
|
||||||
|
|
Loading…
Reference in New Issue