From 1eda2d04729e5d4d4dcce174a8c001825e14d2d1 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Sun, 11 Jun 2006 19:41:01 +0000 Subject: [PATCH] stop sending ping replys forever, send reply earlier if possible --- iodined.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iodined.c b/iodined.c index b6b00ab..5960057 100644 --- a/iodined.c +++ b/iodined.c @@ -84,7 +84,7 @@ tunnel(int tun_fd, int dns_fd) } if (i==0) { - if (q.type != 0) + if (q.id != 0) dnsd_send(dns_fd, &q, outpacket.data, outpacket.len); outpacket.len = 0; q.id = 0; @@ -107,6 +107,7 @@ tunnel(int tun_fd, int dns_fd) if(in[0] == 'H' || in[0] == 'h') { read = snprintf(out, sizeof(out), "%s-%d", "172.30.5.2", 1023); dnsd_send(dns_fd, &q, out, read); + q.id = 0; } else if((in[0] >= '0' && in[0] <= '9') || (in[0] >= 'a' && in[0] <= 'f') || (in[0] >= 'A' && in[0] <= 'F')) { @@ -129,11 +130,11 @@ tunnel(int tun_fd, int dns_fd) packetbuf.len = packetbuf.offset = 0; } - if (outpacket.len > 0) { - dnsd_send(dns_fd, &q, outpacket.data, outpacket.len); - outpacket.len = 0; - q.id = 0; - } + } + if (outpacket.len > 0) { + dnsd_send(dns_fd, &q, outpacket.data, outpacket.len); + outpacket.len = 0; + q.id = 0; } } }