From 6fa0d98c9930f3de2fefde71a56e853cbd88e515 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Sun, 2 Dec 2007 02:27:36 +0000 Subject: [PATCH] #7 Actually update server_id --- src/iodine.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/iodine.c b/src/iodine.c index 6aa02a4..4dc6217 100644 --- a/src/iodine.c +++ b/src/iodine.c @@ -167,6 +167,10 @@ read_dns(int fd, char *buf, int buflen) } 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) { /* 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) return -1; - + outlen = sizeof(out); inlen = read; if (uncompress((uint8_t*)out, &outlen, (uint8_t*)in, inlen) != Z_OK)