From b71e675e82319f4ea1d76f31cb410c0f065e5a0a Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 17 Jan 2016 13:45:34 +0100 Subject: [PATCH] Native FIN hack --- app/src/main/jni/netguard/netguard.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/jni/netguard/netguard.c b/app/src/main/jni/netguard/netguard.c index 1e51f606..819e1795 100644 --- a/app/src/main/jni/netguard/netguard.c +++ b/app/src/main/jni/netguard/netguard.c @@ -939,6 +939,14 @@ void handle_tcp(JNIEnv *env, jobject instance, const struct arguments *args, cur->remote_seq - cur->remote_start, ntohl(tcphdr->ack_seq) - cur->local_start, cur->local_seq - cur->local_start); + // TODO hack + if (cur->state == TCP_FIN_WAIT1) { + __android_log_print(ANDROID_LOG_ERROR, TAG, "FIN hack"); + if (writeTCP(cur, NULL, 0, 1, 0, 0, 0, args->tun) < 0) // ACK + __android_log_print(ANDROID_LOG_ERROR, TAG, + "write ACK error %d: %s", + errno, strerror((errno))); + } } }