mirror of https://github.com/M66B/NetGuard.git
Native RST when data queued after close linger
This commit is contained in:
parent
6397fcc29a
commit
73367e068c
|
@ -711,7 +711,7 @@ int check_sessions(const struct arguments *args) {
|
||||||
if (t->state != TCP_CLOSING && t->state != TCP_CLOSE && t->time + timeout < now) {
|
if (t->state != TCP_CLOSING && t->state != TCP_CLOSE && t->time + timeout < now) {
|
||||||
// TODO send keep alives?
|
// TODO send keep alives?
|
||||||
log_android(ANDROID_LOG_WARN, "%s idle %d/%d sec ", session, now - t->time, timeout);
|
log_android(ANDROID_LOG_WARN, "%s idle %d/%d sec ", session, now - t->time, timeout);
|
||||||
if (t->state == TCP_CLOSE_WAIT) {
|
if (t->state == TCP_CLOSE_WAIT && t->forward == NULL) {
|
||||||
t->remote_seq++; // remote FIN
|
t->remote_seq++; // remote FIN
|
||||||
if (write_fin_ack(args, t) >= 0) {
|
if (write_fin_ack(args, t) >= 0) {
|
||||||
log_android(ANDROID_LOG_WARN, "%s finished idle", session);
|
log_android(ANDROID_LOG_WARN, "%s finished idle", session);
|
||||||
|
@ -719,9 +719,11 @@ int check_sessions(const struct arguments *args) {
|
||||||
t->state = TCP_LAST_ACK;
|
t->state = TCP_LAST_ACK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
log_android(ANDROID_LOG_WARN, "%s reset idle", session);
|
||||||
write_rst(args, t);
|
write_rst(args, t);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check closing sessions
|
// Check closing sessions
|
||||||
if (t->state == TCP_CLOSING) {
|
if (t->state == TCP_CLOSING) {
|
||||||
|
|
Loading…
Reference in New Issue