]> git.ipfire.org Git - thirdparty/strongswan.git/commit
testing: Wait for packets to be processed by tcpdump
authorTobias Brunner <tobias@strongswan.org>
Tue, 14 Jun 2016 18:41:43 +0000 (20:41 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 16 Jun 2016 12:36:15 +0000 (14:36 +0200)
commit63acd803f08e75f5838e8327d366e792267a6275
tree600a96020ccb96de2f37d66aed6ea43e37ab006a
parenteb25b1a73d320532974dfd80411773673ea90820
testing: Wait for packets to be processed by tcpdump

Sometimes tcpdump fails to process all packets during the short running
time of a scenario:

0 packets captured
18 packets received by filter
0 packets dropped by kernel

So 18 packets were captured by libpcap but tcpdump did not yet process
and print them.

This tries to use --immediate-mode if supported by tcpdump (the one
currently in jessie or wheezy does not, but the one in jessie-backports
does), which disables the buffering in libpcap.

However, even with immediate mode there are cases where it takes a while
longer for all packets to get processed.  And without it we also need a
workaround (even though the version in wheezy actually works fine).
That's why there now is a loop checking for differences in captured vs.
received packets.  There are actually cases where these numbers are not
equal but we still captured all packets we're interested in, so we abort
after 1s of retrying.  But sometimes it could still happen that packets
we expected got lost somewhere ("packets dropped by kernel" is not
always 0 either).
testing/do-tests