Skip to content

Commit ace1c33

Browse files
hsfz: incorrect_tester_address packets have addressing.
1 parent 71c4d88 commit ace1c33

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

scapy/contrib/automotive/bmw/hsfz.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ class HSFZ(Packet):
7070

7171
def _hasaddrs(self):
7272
# type: () -> bool
73-
# Address present in diagnostic_req_res, acknowledge_transfer and
74-
# two byte length alive_check frames.
73+
# Address present in diagnostic_req_res, acknowledge_transfer,
74+
# two byte length alive_check and incorrect_tester_address frames.
7575
return self.control == 0x01 or \
7676
self.control == 0x02 or \
77-
(self.control == 0x12 and self.length == 2)
77+
(self.control == 0x12 and self.length == 2) or \
78+
self.control == 0x40
7879

7980
def _hasidstring(self):
8081
# type: () -> bool

test/contrib/automotive/bmw/hsfz.uts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ assert pkt.source == 0x00
124124
assert pkt.target == 0xf4
125125

126126

127+
= Dissect incorrect tester address
128+
pkt = HSFZ(bytes.fromhex("000000020040fff4"))
129+
assert pkt.length == 2
130+
assert pkt.control == 0x40
131+
assert pkt.source == 0xff
132+
assert pkt.target == 0xf4
133+
134+
127135
= Test HSFZSocket
128136

129137
server_up = threading.Event()

0 commit comments

Comments
 (0)