Skip to content

Commit

Permalink
fin/rst bug
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdavidgraham committed Sep 7, 2013
1 parent 553a171 commit 0c600e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ receive_thread(struct Masscan *masscan,

/* If this is a FIN, handle that. Note that ACK +
* payload + FIN can come together */
if (TCP_IS_FIN(px, parsed.transport_offset)) {
if (TCP_IS_FIN(px, parsed.transport_offset) && !TCP_IS_RST(px, parsed.transport_offset)) {
tcpcon_handle(tcpcon, tcb, TCP_WHAT_FIN,
0, 0, secs, usecs, seqno_them);
}
Expand All @@ -553,6 +553,7 @@ receive_thread(struct Masscan *masscan,
* This happens when we've sent a FIN, deleted our connection,
* but the other side didn't get the packet.
*/
if (!TCP_IS_RST(px, parsed.transport_offset))
tcpcon_send_FIN(
tcpcon,
ip_me, ip_them,
Expand Down

0 comments on commit 0c600e3

Please sign in to comment.