From 045a9d8451edb2797dde1b71c6f2db71b71ad89d Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 8 Jul 2022 11:14:35 +0200 Subject: [PATCH] Fixed a race condition in link establishment flow --- RNS/Transport.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RNS/Transport.py b/RNS/Transport.py index 319ba8e..e78d7c8 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -967,8 +967,6 @@ class Transport: new_raw += packet.raw[2:] outbound_interface = Transport.destination_table[packet.destination_hash][5] - Transport.transmit(outbound_interface, new_raw) - Transport.destination_table[packet.destination_hash][0] = time.time() if packet.packet_type == RNS.Packet.LINKREQUEST: # Entry format is @@ -991,6 +989,9 @@ class Transport: Transport.reverse_table[packet.getTruncatedHash()] = reverse_entry + Transport.transmit(outbound_interface, new_raw) + Transport.destination_table[packet.destination_hash][0] = time.time() + else: # TODO: There should probably be some kind of REJECT # mechanism here, to signal to the source that their