mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-12-05 06:10:07 -05:00
Cleanup
This commit is contained in:
parent
72db6e0ef2
commit
a0f0f31807
4 changed files with 121 additions and 136 deletions
|
|
@ -244,6 +244,9 @@ class Packet:
|
|||
self.flags = self.raw[0]
|
||||
self.hops = self.raw[1]
|
||||
|
||||
if self.hops >= RNS.Transport.PATHFINDER_M:
|
||||
raise ValueError(f"Invalid hop count {self.hops}")
|
||||
|
||||
self.header_type = (self.flags & 0b01000000) >> 6
|
||||
self.context_flag = (self.flags & 0b00100000) >> 5
|
||||
self.transport_type = (self.flags & 0b00010000) >> 4
|
||||
|
|
@ -268,7 +271,7 @@ class Packet:
|
|||
return True
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Received malformed packet, dropping it. The contained exception was: "+str(e), RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
|
||||
RNS.log(f"Received malformed packet, dropping it. The contained exception was: {e}", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
|
||||
return False
|
||||
|
||||
def send(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue