[LTP] [PATCH v4 1/2] pty04: Use guarded buffers for transmission

Petr Vorel pvorel@suse.cz
Wed May 6 14:17:04 CEST 2020


Hi Jan,

> > > -#if defined(HAVE_LINUX_IF_PACKET_H) && defined(HAVE_LINUX_IF_ETHER_H)
> > > +#include <linux/version.h>
> > Shouldn't we also check for <linux/version.h> with autotools? Or are kernel
> > headers mandatory for LTP build?

> We already include this header in some syscalls tests, so I assumed it won't be an issue.

OK, no problem.

> > > +
> > > +#if defined(HAVE_LINUX_IF_PACKET_H) && defined(HAVE_LINUX_IF_ETHER_H) \
> > > +       && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)

> > >  #include <linux/if_packet.h>
> > >  #include <linux/if_ether.h>
> > > @@ -373,6 +376,6 @@ static struct tst_test test = {

> > >  #else

> > > -TST_TEST_TCONF("Need <linux/if_packet.h> and <linux/if_ether.h>");
> > > +TST_TEST_TCONF("Need <linux/if_packet.h> and <linux/if_ether.h> and
> > > 4.10+");

> > +1.

> > BTW, why this tests requires 4.10 for runtime?

> It's for compilation. struct can_frame fields it's using were introduced in 4.10.

Do you mean a2f11835994e ("can.h: make padding given by gcc explicit") from
v4.2-rc1? + there is no change for include/uapi/linux/can.h in 4.10.

This is just a separate question to this fix (thank you for finding a solution).

Kind regards,
Petr


More information about the ltp mailing list