From patchwork Mon Oct 13 19:12:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 399266 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id C4A1F1400D5 for ; Tue, 14 Oct 2014 06:22:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C57F1954D1; Mon, 13 Oct 2014 19:22:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X7p5vRbYObBB; Mon, 13 Oct 2014 19:22:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id CBF2A9541C; Mon, 13 Oct 2014 19:22:30 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 15D081C216A for ; Mon, 13 Oct 2014 19:22:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0E95091D94 for ; Mon, 13 Oct 2014 19:22:29 +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 QuiGSXTWyKxC for ; Mon, 13 Oct 2014 19:22:26 +0000 (UTC) X-Greylist: delayed 00:09:41 by SQLgrey-1.7.6 Received: from ch3vs01.rockwellcollins.com (ch3vs01.rockwellcollins.com [205.175.226.27]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7511591D9F for ; Mon, 13 Oct 2014 19:22:26 +0000 (UTC) Received: from ofwch3n02.rockwellcollins.com (HELO crulimr01.rockwellcollins.com) ([205.175.226.14]) by ch3vs01.rockwellcollins.com with ESMTP; 13 Oct 2014 14:12:46 -0500 X-Received: from drax.rockwellcollins.com (srcnat-vips-vlan26.rockwellcollins.com [131.198.26.18]) by crulimr01.rockwellcollins.com (Postfix) with ESMTP id A2C6960120; Mon, 13 Oct 2014 14:12:44 -0500 (CDT) From: Matt Weber To: buildroot@busybox.net Date: Mon, 13 Oct 2014 14:12:43 -0500 Message-Id: <1413227563-5383-1-git-send-email-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Buildroot] [PATCH 1/1] iptables: fix userspace compilation of ip tables with C++ 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Matt Weber --- ...ix-userspace-compilation-of-ip_tables_c_h.patch | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 package/iptables/iptables-03-fix-userspace-compilation-of-ip_tables_c_h.patch diff --git a/package/iptables/iptables-03-fix-userspace-compilation-of-ip_tables_c_h.patch b/package/iptables/iptables-03-fix-userspace-compilation-of-ip_tables_c_h.patch new file mode 100644 index 0000000..5b769b1 --- /dev/null +++ b/package/iptables/iptables-03-fix-userspace-compilation-of-ip_tables_c_h.patch @@ -0,0 +1,43 @@ +From: Jason Gunthorpe +Date: Sun, 30 Sep 2012 22:49:11 -0600 +Subject: [PATCH] Fix userspace compilation of ip_tables.h/ip6_tables.h in + C++ mode + +The implicit cast from void * is not allowed for C++ compilers, and the +arithmetic on void * generates warnings in C++ mode. + +$ g++ -c t.cc +ip_tables.h:221:24: warning: pointer of type 'void *' used in arithmetic +ip_tables.h:221:24: error: invalid conversion from 'void*' to 'xt_entry_target*' + +Signed-off-by: Jason Gunthorpe +--- + include/linux/netfilter_ipv4/ip_tables.h | 2 +- + include/linux/netfilter_ipv6/ip6_tables.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) +diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h +index db79231..050ad8a 100644 +--- a/include/linux/netfilter_ipv4/ip_tables.h ++++ b/include/linux/netfilter_ipv4/ip_tables.h +@@ -226,7 +226,7 @@ struct ipt_get_entries { + static __inline__ struct xt_entry_target * + ipt_get_target(struct ipt_entry *e) + { +- return (void *)e + e->target_offset; ++ return (struct xt_entry_target *)((__u8 *)e + e->target_offset); + } + + /* +diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h +index 08c2cbb..3349bf1 100644 +--- a/include/linux/netfilter_ipv6/ip6_tables.h ++++ b/include/linux/netfilter_ipv6/ip6_tables.h +@@ -263,7 +263,7 @@ struct ip6t_get_entries { + static __inline__ struct xt_entry_target * + ip6t_get_target(struct ip6t_entry *e) + { +- return (void *)e + e->target_offset; ++ return (struct xt_entry_target *)((__u8 *)e + e->target_offset); + } + + /*