Commit 913450f1 authored by yonghong-song's avatar yonghong-song Committed by GitHub

Merge pull request #1635 from nirmoy/python_compat

properly retrieve IP address from array for python2.7
parents d6f716bc 505f98d3
......@@ -54,8 +54,8 @@ def print_skb_event(cpu, data, size):
# Only print for echo request
if icmp_type == 128:
src_ip = bytes(skb_event.raw[22:38])
dst_ip = bytes(skb_event.raw[38:54])
src_ip = bytes(bytearray(skb_event.raw[22:38]))
dst_ip = bytes(bytearray(skb_event.raw[38:54]))
print("%-3s %-32s %-12s 0x%08x" %
(cpu, socket.inet_ntop(socket.AF_INET6, src_ip),
socket.inet_ntop(socket.AF_INET6, dst_ip),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment