1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-27 00:57:47 +08:00

do not shortcut analysis just because there's no IP or UDP header

This commit is contained in:
Joel Bender
2018-04-02 16:52:10 -04:00
parent 9f0eafa52f
commit 51599f8505
3 changed files with 12 additions and 12 deletions

View File

@@ -23,7 +23,7 @@ try:
except:
pass
from .debugging import ModuleLogger, DebugContents, bacpypes_debugging, btox
from .debugging import ModuleLogger, bacpypes_debugging, btox
from .pdu import PDU, Address
from .bvll import BVLPDU, bvl_pdu_types, ForwardedNPDU, \
@@ -147,6 +147,8 @@ def decode_packet(data):
# assume it is ethernet for now
d = decode_ethernet(data)
pduSource = Address(d['source_address'])
pduDestination = Address(d['destination_address'])
data = d['data']
# there could be a VLAN header
@@ -177,10 +179,8 @@ def decode_packet(data):
decode_packet._debug(" - pduDestination: %r", pduDestination)
else:
if _debug: decode_packet._debug(" - not a UDP packet")
return None
else:
if _debug: decode_packet._debug(" - not an IP packet")
return None
# check for empty
if not data:
@@ -364,7 +364,7 @@ bacpypes_debugging(decode_file)
# Tracer
#
class Tracer(DebugContents):
class Tracer:
def __init__(self, initial_state=None):
if _debug: Tracer._debug("__init__ initial_state=%r", initial_state)