Commit f7bb06c0 authored by StevenWdV's avatar StevenWdV
Browse files

Fixed bug regarding first_recv_syn_nr and simultaneous open

parent 1d32f477
...@@ -147,6 +147,8 @@ class _Stream: ...@@ -147,6 +147,8 @@ class _Stream:
self.send_syn_nr = self.first_send_syn_nr # Next to be sent self.send_syn_nr = self.first_send_syn_nr # Next to be sent
self.send_ack_nr = self.send_syn_nr # First not ACKed by other self.send_ack_nr = self.send_syn_nr # First not ACKed by other
self.first_recv_syn_nr = None
self.__send_to_be_acked(b"", self.send_syn_nr, _Flags((True, False, False))) self.__send_to_be_acked(b"", self.send_syn_nr, _Flags((True, False, False)))
else: else:
...@@ -211,12 +213,12 @@ class _Stream: ...@@ -211,12 +213,12 @@ class _Stream:
logging.warning(self.deb + "SYN-ACK expected") logging.warning(self.deb + "SYN-ACK expected")
continue continue
elif flags.syn: elif flags.syn:
if packet.header.syn_nr == self.first_recv_syn_nr: if self.first_recv_syn_nr is not None and packet.header.syn_nr == self.first_recv_syn_nr:
logging.debug(self.deb + "Spurious SYN") logging.debug(self.deb + "Spurious SYN")
continue continue
else: else:
logging.warning(self.deb + "Unexpected SYN") logging.warning(self.deb + "Unexpected SYN")
# TODO simultaneous open # TODO simultaneous open if self.first_recv_syn_nr is None
continue continue
if packet.header.syn_nr > self.recv_syn_nr + self.local_window_size: if packet.header.syn_nr > self.recv_syn_nr + self.local_window_size:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment