From 97f4ba8c54c73a4c0106e72065adcb5e69f99a9d Mon Sep 17 00:00:00 2001
From: Martin Teichmann <martin.teichmann@xfel.eu>
Date: Thu, 16 Feb 2023 16:46:54 +0100
Subject: [PATCH] drop package if future is already done

---
 ebpfcat/ethercat.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ebpfcat/ethercat.py b/ebpfcat/ethercat.py
index da46569..5b9e103 100644
--- a/ebpfcat/ethercat.py
+++ b/ebpfcat/ethercat.py
@@ -293,8 +293,10 @@ class EtherCat(Protocol):
                     if wkc == 0:
                         future.set_exception(
                             EtherCatError("datagram was not processed"))
-                    else:
+                    elif not future.done():
                         future.set_result(data[start:stop])
+                    else:
+                        print("dropped package")
                 dgrams = []
                 packet = Packet()
 
-- 
GitLab