From 757f59e350319c756ced95234bc3b135e134ba87 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Sat, 10 Feb 2007 22:52:15 +0000 Subject: [PATCH] checking return value from decompress, to avoid sending 64k packages on the tun every time there is a datacorruption --- src/iodine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/iodine.c b/src/iodine.c index a6bdf8e..2054cc6 100644 --- a/src/iodine.c +++ b/src/iodine.c @@ -166,7 +166,8 @@ tunnel_dns(int tun_fd, int dns_fd) outlen = sizeof(out); inlen = read; - uncompress(out, &outlen, in, inlen); + if (uncompress(out, &outlen, in, inlen) != Z_OK) + return -1; write_tun(tun_fd, out, outlen); if (!is_sending()) @@ -362,6 +363,7 @@ handshake(int dns_fd) perform_login: login_calculate(login, 16, password, seed); + for (i=0; running && i<5 ;i++) { tv.tv_sec = i + 1; tv.tv_usec = 0;