Skip to content

Commit

Permalink
Merge pull request #110 from CESNET/tcp_seq_ack_fix
Browse files Browse the repository at this point in the history
FIX: Parsing TCP SEQ and TCP ACK numbers
  • Loading branch information
hynekkar authored Dec 5, 2022
2 parents 0594d27 + 5b846ba commit e81ec0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions input/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,11 @@ inline uint16_t parse_tcp_hdr(const u_char *data_ptr, uint16_t data_len, Packet
throw "Parser detected malformed packet";
}


pkt->src_port = ntohs(tcp->source);
pkt->dst_port = ntohs(tcp->dest);
pkt->tcp_seq = ntohl(tcp->seq);
pkt->tcp_ack = ntohl(tcp->ack_seq);
pkt->tcp_flags = (uint8_t) *(data_ptr + 13) & 0xFF;
pkt->tcp_window = ntohs(tcp->window);

Expand Down

0 comments on commit e81ec0e

Please sign in to comment.