mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-26 06:56:05 +03:00
stop sending ping replys forever, send reply earlier if possible
This commit is contained in:
parent
449bc77f57
commit
1eda2d0472
@ -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,6 +130,7 @@ 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;
|
||||
@ -137,7 +139,6 @@ tunnel(int tun_fd, int dns_fd)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user