Stop client if server is restarted

This commit is contained in:
Erik Ekman 2008-09-09 19:37:51 +00:00 committed by Erik Ekman
parent bd45e6ccb2
commit b38293c11b
2 changed files with 7 additions and 0 deletions

View file

@ -18,6 +18,7 @@ CHANGES:
from Francois Revol. Still work to do to get tun device working. from Francois Revol. Still work to do to get tun device working.
- Added capability to forward DNS queries outside tunnel domain to - Added capability to forward DNS queries outside tunnel domain to
a nameserver on localhost. Use -b port to enable. a nameserver on localhost. Use -b port to enable.
- iodine client now shuts down if it detects a server restart.
2008-08-06: 0.4.2 "Opened Zone" 2008-08-06: 0.4.2 "Opened Zone"
- Applied a few small patches from Maxim Bourmistrov and Gregor Herrmann - Applied a few small patches from Maxim Bourmistrov and Gregor Herrmann

View file

@ -226,6 +226,12 @@ 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;
if (read == 5 && strncmp("BADIP", in, 5) == 0) {
errx(3, "Not recognized by server. "
"Has it been restarted? Aborting");
/* NOTREACHED */
}
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)