antrea-io / antrea

Kubernetes networking based on Open vSwitch
https://antrea.io
Apache License 2.0
1.67k stars 370 forks source link

Fix PacketCapture pcapng file issue on macOS #6804

Closed hangyan closed 1 week ago

hangyan commented 2 weeks ago

By default, gopacket will write snap length=0 in the pcapng file header, means unlimited snaplen. tcpdump on osx(libpcap version 1.10.1) cannot recognize this and will report error. This patch will set a default value(524288) for it. This patch also add packets file verification in e2e tests.

origin error message:

tcpdump: pcap_loop: invalid packet capture length 74, bigger than snaplen of 524288

pcapng format ref: https://pcapng.com/

antoninbas commented 1 week ago

/test-all

antoninbas commented 1 week ago

Unrelated e2e test failures in TestAntreaPolicy

luolanzone commented 1 week ago

@hangyan can you back port this PR to release 2.2.

hangyan commented 1 week ago

@hangyan can you back port this PR to release 2.2.

sure