From patchwork Wed Apr 4 11:12:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 894933 X-Patchwork-Delegate: akodanev@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 40GNqw5xFsz9s0b for ; Wed, 4 Apr 2018 21:23:24 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 494843E60AB for ; Wed, 4 Apr 2018 13:23:22 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) by picard.linux.it (Postfix) with ESMTP id 23C183E6087 for ; Wed, 4 Apr 2018 13:23:21 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-7.smtp.seeweb.it (Postfix) with ESMTP id BF5F02009AB for ; Wed, 4 Apr 2018 13:23:15 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="38610875" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 04 Apr 2018 19:23:13 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id A7D734D0EFE1; Wed, 4 Apr 2018 19:23:13 +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 19:23:13 +0800 From: Xiao Yang To: , Date: Wed, 4 Apr 2018 19:12:54 +0800 Message-ID: <1522840374-10311-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.167.220.185] X-yoursite-MailScanner-ID: A7D734D0EFE1.ABF63 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-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Cc: ltp@lists.linux.it Subject: [LTP] [PATCH v2] 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) Remove the include of linux/sctp.h to fix it. 2) Include netinet/sctp.h, if it was available. Signed-off-by: Xiao Yang --- configure.ac | 2 +- include/lapi/sctp.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 9358064..9208f1c 100644 --- a/configure.ac +++ b/configure.ac @@ -44,8 +44,8 @@ AC_CHECK_HEADERS([ \ linux/mempolicy.h \ linux/module.h \ linux/netlink.h \ - linux/sctp.h \ mm.h \ + netinet/sctp.h \ pthread.h \ sys/epoll.h \ sys/fanotify.h \ diff --git a/include/lapi/sctp.h b/include/lapi/sctp.h index 69adc7a..647052b 100644 --- a/include/lapi/sctp.h +++ b/include/lapi/sctp.h @@ -18,8 +18,8 @@ #ifndef LAPI_SCTP_H__ #define LAPI_SCTP_H__ -#ifdef HAVE_LINUX_SCTP_H -# include +#ifdef HAVE_NETINET_SCTP_H +# include #endif #ifndef SCTP_SOCKOPT_BINDX_ADD