From 1a2da0d7c75bd6d72facf6dabca79ef73645168d Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 28 Apr 2022 10:38:34 +0200 Subject: [PATCH] Drop IFAC packets on non-IFAC interfaces --- RNS/Transport.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/RNS/Transport.py b/RNS/Transport.py index cc773e1..3cd2095 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -758,6 +758,15 @@ class Transport: RNS.log(str(interface)+" with IFAC enabled received packet without access code, dropping.", RNS.LOG_EXTREME) return + else: + # If the interface does not have IFAC enabled, + # check the received packet IFAC flag. + if raw[0] & 0x80 == 0x80: + # If the flag is set, drop the packet + # TODO: Remove log statements + RNS.log(str(interface)+" with IFAC disabled received packet with access code, dropping.", RNS.LOG_EXTREME) + return + while (Transport.jobs_running): sleep(0.01)