From 8f3da961e7802340f9a77d437631c6bbe94e0102 Mon Sep 17 00:00:00 2001 From: Hemna Date: Mon, 25 Nov 2024 17:11:19 -0500 Subject: [PATCH] Update RX Packet dupe checking Lots of APRS messages don't have message ids in the packet. This prevents packet.msgNo from having a value. so when we look the packet up in the packet_list, the packet key has a None for a value for the msgNo portion of the key. This results in every packet after the first from that callsign that doesn't have a msg id, will be marked as a dupe and will never be processed. This patch checks to see if msgNo is None. If it is, then just mark the packet as never being seen and pass it on the chain to be processed. This also means that there should never be an Ack sent for those packets that don't container a msgNo value. --- aprsd/threads/rx.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/aprsd/threads/rx.py b/aprsd/threads/rx.py index c629a5b..f2edb94 100644 --- a/aprsd/threads/rx.py +++ b/aprsd/threads/rx.py @@ -121,6 +121,12 @@ class APRSDDupeRXThread(APRSDRXThread): # Find the packet in the list of already seen packets # Based on the packet.key found = pkt_list.find(packet) + if not packet.msgNo: + # If the packet doesn't have a message id + # then there is no reliable way to detect + # if it's a dupe, so we just pass it on. + # it shouldn't get acked either. + found = False except KeyError: found = False @@ -223,7 +229,10 @@ class APRSDProcessPacketThread(APRSDThread): self.process_piggyback_ack(packet) # Only ack messages that were sent directly to us if isinstance(packet, packets.MessagePacket): - if to_call and to_call.lower() == our_call: + if ( + to_call and to_call.lower() == our_call + and msg_id + ): # It's a MessagePacket and it's for us! # let any threads do their thing, then ack # send an ack last