[PATCH v1 2/3] tests: check decoding of setsockopt(PACKET_[R|T]X_RING)

Dmitry V. Levin ldv at altlinux.org
Thu Aug 2 12:37:49 UTC 2018


On Tue, Jul 24, 2018 at 04:59:15PM +0800, Zhibin Li wrote:
> * tests/net-tpacket_req.c: New file.
> * tests/.gitignore: Add net-tpacket_req.
> * tests/pure_executables.list: Likewise.
> * tests/gen_tests.in (net-tpacket_req): New test.
> ---
>  tests/.gitignore            |  1 +
>  tests/gen_tests.in          |  1 +
>  tests/net-tpacket_req.c     | 50 +++++++++++++++++++++++++++++++++++++
>  tests/pure_executables.list |  1 +
>  4 files changed, 53 insertions(+)
>  create mode 100644 tests/net-tpacket_req.c
[...]
> diff --git a/tests/net-tpacket_req.c b/tests/net-tpacket_req.c
> new file mode 100644
> index 00000000..f9c05043
> --- /dev/null
> +++ b/tests/net-tpacket_req.c
> @@ -0,0 +1,50 @@
[...]
> +int
> +main(void)
> +{
> +	test_tpacket_req(ARG_STR(PACKET_RX_RING));
> +	test_tpacket_req(ARG_STR(PACKET_TX_RING));

On oldish systems this fails to compile with the following diagnostics:
net-tpacket_req.c: In function 'main':
net-tpacket_req.c:46: error: 'PACKET_TX_RING' undeclared (first use in this function)

PACKET_TX_RING was introduced by Linux kernel commit
v2.6.31-rc1~14^2~446 so oldish systems do not have it, consider #ifdef'ing
such constants.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20180802/8f042369/attachment.bin>


More information about the Strace-devel mailing list