From patchwork Thu Nov 3 13:25:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 690830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t8m2629RTz9vDS for ; Fri, 4 Nov 2016 00:26:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 917772E264; Thu, 3 Nov 2016 13:26:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9aPCyWSG0fNp; Thu, 3 Nov 2016 13:26:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id A4BD0329A7; Thu, 3 Nov 2016 13:26:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 266A21C168D for ; Thu, 3 Nov 2016 13:26:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1F52592660 for ; Thu, 3 Nov 2016 13:26:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F-Hcl7tioSur for ; Thu, 3 Nov 2016 13:25:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by whitealder.osuosl.org (Postfix) with ESMTP id E1AE086D10 for ; Thu, 3 Nov 2016 13:25:56 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 685D75965AE0A for ; Thu, 3 Nov 2016 13:25:51 +0000 (GMT) Received: from vriera-linux.le.imgtec.org (192.168.154.36) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 3 Nov 2016 13:25:53 +0000 From: Vicente Olivert Riera To: Date: Thu, 3 Nov 2016 13:25:46 +0000 Message-ID: <20161103132546.52679-1-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 X-Originating-IP: [192.168.154.36] Subject: [Buildroot] [PATCH] net-tools: add a patch to avoid struct redefinition X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This fixes a struct redefinition problem like this one: ================================ In file included from /usr/include/linux/if_tunnel.h:6:0, from iptunnel.c:34: /usr/include/linux/ip.h:85:8: error: redefinition of 'struct iphdr' struct iphdr { ^ In file included from iptunnel.c:29:0: /usr/include/netinet/ip.h:45:8: note: originally defined here struct iphdr ^ ================================ iptunnel.c includes netinet/ip.h which contains a definition of the iphdr struct. iptunnel.c also includes linux/if_tunnel.h which includes linux/ip.h which contains a definition of the iphdr struct. So, both netinet/ip.h and linux/ip.h define the iphdr struct, and both of them have been included directly or indirectly by iptunnel.c. Because of that the compilation fails due to a struct redefinition. The problem can be solved by just not including netinet/ip.h. The patch has been sent upstream as a merge request: https://sourceforge.net/p/net-tools/code/merge-requests/3/ Fixes: http://autobuild.buildroot.net/results/dce/dce499da84b2a41bab946d5109a283ccb85c8b81/ Signed-off-by: Vicente Olivert Riera --- ...02-iptunnel.c-do-not-include-netinet-ip.h.patch | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 package/net-tools/0002-iptunnel.c-do-not-include-netinet-ip.h.patch diff --git a/package/net-tools/0002-iptunnel.c-do-not-include-netinet-ip.h.patch b/package/net-tools/0002-iptunnel.c-do-not-include-netinet-ip.h.patch new file mode 100644 index 0000000..002c9da --- /dev/null +++ b/package/net-tools/0002-iptunnel.c-do-not-include-netinet-ip.h.patch @@ -0,0 +1,54 @@ +From 7a9a369d9de784791a2ab384877aab5ff3801d4e Mon Sep 17 00:00:00 2001 +From: Vicente Olivert Riera +Date: Thu, 3 Nov 2016 12:59:39 +0000 +Subject: [PATCH] iptunnel.c: do not include netinet/ip.h + +This fixes a struct redefinition problem like this one: + +================================ +In file included from /usr/include/linux/if_tunnel.h:6:0, + from iptunnel.c:34: +/usr/include/linux/ip.h:85:8: error: redefinition of 'struct iphdr' + struct iphdr { + ^ +In file included from iptunnel.c:29:0: +/usr/include/netinet/ip.h:45:8: note: originally defined here + struct iphdr + ^ +================================ + +iptunnel.c includes netinet/ip.h which contains a definition of the +iphdr struct. + +iptunnel.c also includes linux/if_tunnel.h which includes linux/ip.h +which contains a definition of the iphdr struct. + +So, both netinet/ip.h and linux/ip.h define the iphdr struct, and both +of them have been included directly or indirectly by iptunnel.c. Because +of that the compilation fails due to a struct redefinition. + +The problem can be solved by just not including netinet/ip.h. + +Upstream status: merge request sent +https://sourceforge.net/p/net-tools/code/merge-requests/3/ + +Signed-off-by: Vicente Olivert Riera +--- + iptunnel.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/iptunnel.c b/iptunnel.c +index 3fe1b84..247ae10 100644 +--- a/iptunnel.c ++++ b/iptunnel.c +@@ -26,7 +26,6 @@ + #include + #include + #include +-#include + #include + #include + #include +-- +2.10.1 +