1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-12-21 09:01:23 -05:00

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.
This commit is contained in:
Hemna 2024-11-25 17:11:19 -05:00
parent aba5bb03a2
commit 8f3da961e7

View File

@ -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