Skip to content

Commit 43738be

Browse files
authored
Ensure that hashret() returns bytes (#3148)
1 parent 8209447 commit 43738be

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

scapy/layers/lltd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def mysummary(self):
111111

112112
def hashret(self):
113113
tos, function = self.tos, self.function
114-
return "%c%c" % self.answer_hashret.get((tos, function),
115-
(tos, function))
114+
return b"%c%c" % self.answer_hashret.get((tos, function),
115+
(tos, function))
116116

117117
def answers(self, other):
118118
if not isinstance(other, LLTD):

test/scapy/layers/lltd.uts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ assert pkt.dst == pkt.real_dst
2020
assert pkt.src == pkt.real_src
2121
assert pkt.tos == 0
2222
assert pkt.function == 0
23+
assert pkt.hashret() == b'\xd9\x88\x00\x00'
2324

2425
= Attribute build / dissection
2526
assert isinstance(LLTDAttribute(), LLTDAttribute)

0 commit comments

Comments
 (0)