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

Zhibin Li 08826794brmt at gmail.com
Thu Aug 2 15:36:09 UTC 2018


OK, I see. I had made such mistakes before and I should've been more
careful.

On Thu, Aug 2, 2018 at 8:37 PM Dmitry V. Levin <ldv at altlinux.org> wrote:

> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20180802/a671f9b0/attachment.html>


More information about the Strace-devel mailing list