Skip to content

Commit

Permalink
Fix crash in simple_eth_raw_packet_with_taglist()
Browse files Browse the repository at this point in the history
  • Loading branch information
bratashX authored and antoninbas committed Jan 25, 2021
1 parent c916077 commit c221d0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ptf/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1739,9 +1739,11 @@ def simple_eth_raw_packet_with_taglist(pktlen=60,
for i in range(1, len(dl_tpid_list)):
pkt[Dot1Q:i].type=dl_tpid_list[i]
pkt.type=dl_tpid_list[0]
pkt[Dot1Q:len(dl_tpid_list)].type = pktlen - len(pkt)
else:
pkt.type = pktlen - len(pkt)

# Fill payload length
pkt[Dot1Q:len(dl_tpid_list)].type = pktlen - len(pkt)
pkt = pkt/codecs.decode("".join(["%02x"%(x%256) for x in range(pktlen - len(pkt))]), "hex")
return pkt

Expand Down

0 comments on commit c221d0c

Please sign in to comment.