On Wed, May 30, 2018 at 10:07 AM Wang Jian <
jianjia...@gmail.com> wrote:
> Seems related to my OS. I changed to a ubuntu 4.17 to run script and have
no problem.
> But if run it with a CentOS 7(3.10), then it will fail.
> Don't know why..
Thanks for the report!
Do you mind if I credit your name and email address in a Reported-by tag in
the commit description for the patch that fixes this? See:
https://www.kernel.org/doc/html/v4.16/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes
The clue as to the cause is in this error message:
./reord1.pkt:17: expected getsockopt(SOL_TCP, 11) output of at least 192
bytes; got 104 bytes
This is from get_data() in code.c:
https://github.com/google/packetdrill/blob/master/gtests/net/packetdrill/code.c
We recently pushed an update to packetdrill that knows about more recent
fields of tcp_info (192 bytes worth of fields). But some distributions have
kernels that are older. Here the OS only exports 104 bytes, which met
packetdrill's previous expectations, but does not meet the expectations of
the more recent packetdrill release.
In general, there is no easy way for packetdrill to tell how old the kernel
is in order to validate the amount of data returned by tcp_info. So my
proposed fix (attached) would be to just remove this size check from the
packetdrill tool. This will mean that fields not exported by the kernel
under test will be zero (get_data() in code.c uses calloc()).
I suppose we could make the packetdrill code fancier, and only define
python variables for the fields that were actually exported by the kernel.
We could teach packetdrill about tcp_info in terms of a table with {name,
offset, size, type}, or something like that. Then packetdrill could decide
to only emit Python definitions for fields where offset+size <
len_of_returned_tcp_info. But that seems like more work than is warranted
at this point. :-)
Let me know if anyone has any other suggestions.
thanks,
neal