1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 21:14:28 +01:00

Added tests for TCPStreamFollower, fixed a bug.

This commit is contained in:
Matias Fontanini
2012-10-02 23:43:31 -03:00
parent ef8344394c
commit 42098e8566
4 changed files with 215 additions and 4 deletions

View File

@@ -88,8 +88,6 @@ bool TCPStream::generic_process(uint32_t &my_seq, uint32_t &other_seq,
payload_type &pload, fragments_type &frags, TCP *tcp, RawPDU *raw)
{
bool added_some(false);
if(tcp->get_flag(TCP::SYN))
other_seq++;
if(tcp->get_flag(TCP::FIN) || tcp->get_flag(TCP::RST))
fin_sent = true;
if(raw && tcp->seq() >= my_seq) {
@@ -115,6 +113,7 @@ bool TCPStream::update(IP *ip, TCP *tcp) {
RawPDU *raw = tcp->find_pdu<RawPDU>();
if(!syn_ack_sent && tcp->get_flag(TCP::SYN) && tcp->get_flag(TCP::ACK)) {
server_seq = tcp->seq() + 1;
client_seq = tcp->ack_seq();
syn_ack_sent = true;
return false;
}