Skip to content
Snippets Groups Projects
Commit 372d3ac8 authored by Tomasz Grabiec's avatar Tomasz Grabiec Committed by Pekka Enberg
Browse files

trace: disable port number conversion in tcpdump mode


tcpdump port number conversions vary from system to system. Turn of the
conversions to have consistent output which is also simpler to assert
for in tests.

Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 272774f0
No related branches found
No related tags found
No related merge requests found
......@@ -253,7 +253,7 @@ def write_sample_to_pcap(sample, pcap_writer):
def format_packet_sample(sample):
assert(is_net_packet_sample(sample))
needs_dpkt()
proc = subprocess.Popen(['tcpdump', '-tn', '-r', '-'], stdin=subprocess.PIPE,
proc = subprocess.Popen(['tcpdump', '-nn', '-t', '-r', '-'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
pcap = dpkt.pcap.Writer(proc.stdin)
write_sample_to_pcap(sample, pcap)
......@@ -282,7 +282,7 @@ def pcap_dump(args, target=None):
pcap_file.close()
def tcpdump(args):
proc = subprocess.Popen(['tcpdump', '-n', '-r', '-'], stdin=subprocess.PIPE, stdout=sys.stdout,
proc = subprocess.Popen(['tcpdump', '-nn', '-r', '-'], stdin=subprocess.PIPE, stdout=sys.stdout,
stderr=subprocess.STDOUT)
try:
pcap_dump(args, target=proc.stdin)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment