public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [COMMITTED] setsockopt08: includes netinet/in.h
@ 2021-08-06  2:56 Li Wang
  2021-08-06  5:40 ` Petr Vorel
  0 siblings, 1 reply; 9+ messages in thread
From: Li Wang @ 2021-08-06  2:56 UTC (permalink / raw)
  To: ltp

We have to put netinet/in.h on the top to get rid of conflict
of glibc and kernel headers for old unbuntu.

  -----------
  /usr/include/linux/in.h:28:3: error: redeclaration of enumerator 'IPPROTO_IP'
        IPPROTO_IP = 0,  /* Dummy protocol for TCP  */
   ^
  /usr/include/netinet/in.h:42:5: note: previous definition of 'IPPROTO_IP' was here
       IPPROTO_IP = 0,    /* Dummy protocol for TCP.  */
  ...
  -----------

See: https://www.mail-archive.com/netdev@vger.kernel.org/msg132711.html

Fixes: ebf3a4fbd39a (Add setsockopt08, CVE-2021-22555)
Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/syscalls/setsockopt/setsockopt08.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt08.c b/testcases/kernel/syscalls/setsockopt/setsockopt08.c
index f758dcbdc..f7052f27b 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt08.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt08.c
@@ -79,6 +79,8 @@
  *  - sizeof(struct xt_entry_target) = 32
  */
 
+#include <netinet/in.h>
+
 #include "tst_test.h"
 #include "tst_safe_net.h"
 #include "lapi/ip_tables.h"
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-20  9:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-06  2:56 [LTP] [COMMITTED] setsockopt08: includes netinet/in.h Li Wang
2021-08-06  5:40 ` Petr Vorel
2021-08-06  5:55   ` Petr Vorel
2021-08-06  8:29     ` Li Wang
2021-08-06  9:37       ` Petr Vorel
2021-08-06 10:18         ` Li Wang
2021-08-06 10:52           ` Richard Palethorpe
2021-08-09  4:03             ` Li Wang
2021-08-20  9:37             ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox