Skip to content

Commit c92a43d

Browse files
committed
Do not run .post_build() when using raw_packet_cache
Fixes #5131
1 parent d36cba8 commit c92a43d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scapy/packet.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,10 @@ def do_build(self):
337337
for t in self.post_transforms:
338338
pkt = t(pkt)
339339
pay = self.do_build_payload()
340-
p = self.post_build(pkt,pay)
341-
return p
340+
if self.raw_packet_cache is None:
341+
return self.post_build(pkt, pay)
342+
else:
343+
return pkt + pay
342344

343345
def build_padding(self):
344346
return self.payload.build_padding()

0 commit comments

Comments
 (0)