void TcpReassembly::handleFinOrRst(TcpReassemblyData* tcpReassemblyData, int sideIndex, uint32_t flowKey) { // if this side already saw a FIN or RST packet, do nothing and return if (tcpReassemblyData->twoSides[sideIndex].gotFinOrRst) return; LOG_DEBUG("Handling FIN or RST packet on side %d", sideIndex); // set FIN/RST flag for this side tcpReassemblyData->twoSides[sideIndex].gotFinOrRst = true; // check if the other side also sees FIN or RST packet. If so - close the flow. Otherwise - only clear the out-of-order packets for this side int otherSideIndex = 1 - sideIndex; if (tcpReassemblyData->twoSides[otherSideIndex].gotFinOrRst) closeConnectionInternal(flowKey, TcpReassembly::TcpReassemblyConnectionClosedByFIN_RST); else checkOutOfOrderFragments(tcpReassemblyData, sideIndex, true); }
void WdtSocket::closeNoCheck() { closeConnectionInternal(false); }
ErrorCode WdtSocket::closeConnection() { return closeConnectionInternal(true); }
void TcpReassembly::closeConnection(uint32_t flowKey) { closeConnectionInternal(flowKey, TcpReassembly::TcpReassemblyConnectionClosedManually); }