RST docs + connection error on test

This commit is contained in:
Domingo Dirutigliano
2025-04-12 20:34:45 +02:00
parent d0b2c67554
commit 129a262704
3 changed files with 5 additions and 5 deletions

View File

@@ -295,7 +295,7 @@ class PktRequest {
if (tcp){ if (tcp){
//If the packet has data, we have to remove it //If the packet has data, we have to remove it
set_data(nullptr, 0); set_data(nullptr, 0);
//For the first matched data or only for data packets, we set FIN bit //For the first matched data or only for data packets, we set RST bit
//This only for client packets, because this will trigger server to close the connection //This only for client packets, because this will trigger server to close the connection
//Packets will be filtered anyway also if client don't send packets //Packets will be filtered anyway also if client don't send packets
if (_data_original_size != 0){ if (_data_original_size != 0){
@@ -585,4 +585,4 @@ uint32_t hash_stream_id(const stream_id &sid) {
} }
}} }}
#endif // NFQUEUE_CLASS_CPP #endif // NFQUEUE_CLASS_CPP

View File

@@ -117,7 +117,7 @@ from firegex.nfproxy import pyfilter
from firegex.nfproxy import REJECT, ACCEPT, UNSTABLE_MANGLE, DROP from firegex.nfproxy import REJECT, ACCEPT, UNSTABLE_MANGLE, DROP
# - The filter must return one of the following values: # - The filter must return one of the following values:
# - ACCEPT: The packet will be accepted # - ACCEPT: The packet will be accepted
# - REJECT: The packet will be rejected (will be activated a mechanism to send a FIN packet and drop all data in the stream) # - REJECT: The packet will be rejected (will be activated a mechanism to send a RST packet and drop all data in the stream)
# - UNSTABLE_MANGLE: The packet will be mangled and accepted # - UNSTABLE_MANGLE: The packet will be mangled and accepted
# - DROP: All the packets in this stream will be easly dropped # - DROP: All the packets in this stream will be easly dropped

View File

@@ -64,7 +64,7 @@ class TcpServer:
def recv_packet(self): def recv_packet(self):
try: try:
return self.client_sock.recv(4096) return self.client_sock.recv(4096)
except TimeoutError: except (TimeoutError, ConnectionResetError):
if self.verbose: if self.verbose:
traceback.print_exc() traceback.print_exc()
return False return False
@@ -76,4 +76,4 @@ class TcpServer:
self.close_client() self.close_client()
if get_data: if get_data:
return received_data return received_data
return received_data == data return received_data == data