Skip to content

Commit 58802a4

Browse files
committed
packet loss header cast
1 parent 1f3570f commit 58802a4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

exercises/11-Packet-Loss-Detection/packet-loss-controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def recv_msg_cpu(self, pkt):
145145
switch_name = interface.split("-")[0]
146146
packet = Ether(str(pkt))
147147
if packet.type == 0x1234:
148-
loss_header = LossHeader(packet.payload)
148+
loss_header = LossHeader(bytes(packet.payload))
149149
batch_id = loss_header.batch_id >> 7
150150
print switch_name, batch_id
151151

exercises/11-Packet-Loss-Detection/solution/packet-loss-controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def recv_msg_cpu(self, pkt):
225225
switch_name = interface.split("-")[0]
226226
packet = Ether(str(pkt))
227227
if packet.type == 0x1234:
228-
loss_header = LossHeader(packet.payload)
228+
loss_header = LossHeader(bytes(packet.payload))
229229
batch_id = loss_header.batch_id >> 7
230230
print switch_name, batch_id
231231
self.check_sw_links(switch_name, batch_id)

0 commit comments

Comments
 (0)