From patchwork Wed Apr 4 08:52:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 894896 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GKk16W4Zz9s0p for ; Wed, 4 Apr 2018 19:03:05 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 01BF13E60AA for ; Wed, 4 Apr 2018 11:02:58 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 2D0B73E6087 for ; Wed, 4 Apr 2018 11:02:55 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-3.smtp.seeweb.it (Postfix) with ESMTP id 9CC261A014AF for ; Wed, 4 Apr 2018 11:02:45 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="38607536" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 04 Apr 2018 17:02:38 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 7B6E64725562; Wed, 4 Apr 2018 17:02:37 +0800 (CST) Received: from RHEL7U5Alpha_SERVER.g08.fujitsu.local (10.167.220.185) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 4 Apr 2018 17:02:37 +0800 From: Xiao Yang To: Date: Wed, 4 Apr 2018 16:52:19 +0800 Message-ID: <1522831939-31257-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.185] X-yoursite-MailScanner-ID: 7B6E64725562.A6F41 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No, score=-0.0 required=7.0 tests=T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH] sctp/sctp_big_chunk.c: Fix compiler error X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" On old distros(e.g. RHEL5), Compilation failed because of redefinitions from linux/sctp.h(including linux/in.h) and netinet/in.h, as below: ---------------------------------------------------------------------- In file included from /usr/include/linux/sctp.h:54, from ../../../include/lapi/sctp.h:22, from sctp_big_chunk.c:35: /usr/include/linux/in.h:26: error: redeclaration of enumerator ‘IPPROTO_IP’ /usr/include/netinet/in.h:33: error: previous definition of ‘IPPROTO_IP’ was here ... ---------------------------------------------------------------------- 1) There was a existed netinet/sctp.h based on lksctp-tools-devel package in LTP, so we used netinet/sctp.h to fix it as the sctp tests did. 2) We removed lapi/sctp.h and duplicated SOL_SCTP in lapi/socket.h. Signed-off-by: Xiao Yang --- configure.ac | 1 - include/lapi/sctp.h | 29 ----------------------------- include/lapi/socket.h | 4 ---- testcases/network/sctp/Makefile | 2 ++ testcases/network/sctp/sctp_big_chunk.c | 2 +- 5 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 include/lapi/sctp.h diff --git a/configure.ac b/configure.ac index 9358064..1721ff2 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,6 @@ AC_CHECK_HEADERS([ \ linux/mempolicy.h \ linux/module.h \ linux/netlink.h \ - linux/sctp.h \ mm.h \ pthread.h \ sys/epoll.h \ diff --git a/include/lapi/sctp.h b/include/lapi/sctp.h deleted file mode 100644 index 69adc7a..0000000 --- a/include/lapi/sctp.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2018 Oracle and/or its affiliates. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef LAPI_SCTP_H__ -#define LAPI_SCTP_H__ - -#ifdef HAVE_LINUX_SCTP_H -# include -#endif - -#ifndef SCTP_SOCKOPT_BINDX_ADD -# define SCTP_SOCKOPT_BINDX_ADD 100 -#endif - -#endif /* LAPI_SCTP_H__ */ diff --git a/include/lapi/socket.h b/include/lapi/socket.h index d58c460..426906f 100644 --- a/include/lapi/socket.h +++ b/include/lapi/socket.h @@ -45,10 +45,6 @@ # define SOCK_CLOEXEC 02000000 #endif -#ifndef SOL_SCTP -# define SOL_SCTP 132 -#endif - #ifndef SOL_UDPLITE # define SOL_UDPLITE 136 /* UDP-Lite (RFC 3828) */ #endif diff --git a/testcases/network/sctp/Makefile b/testcases/network/sctp/Makefile index 0fa9125..ac4a99a 100644 --- a/testcases/network/sctp/Makefile +++ b/testcases/network/sctp/Makefile @@ -17,6 +17,8 @@ top_srcdir ?= ../../.. include $(top_srcdir)/include/mk/testcases.mk +CPPFLAGS += -I$(top_srcdir)/utils/sctp/include + INSTALL_TARGETS := sctp01.sh include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/sctp/sctp_big_chunk.c b/testcases/network/sctp/sctp_big_chunk.c index 55a2969..d3288ee 100644 --- a/testcases/network/sctp/sctp_big_chunk.c +++ b/testcases/network/sctp/sctp_big_chunk.c @@ -32,7 +32,7 @@ #include "tst_safe_stdio.h" #include "lapi/netinet_in.h" #include "lapi/socket.h" -#include "lapi/sctp.h" +#include "netinet/sctp.h" static int port; static int sfd, cfd;