From patchwork Sun Aug 2 19:10:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Heading X-Patchwork-Id: 502924 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id CF6F4140D26 for ; Mon, 3 Aug 2015 05:10:27 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Jtlu/KKt; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EA775A19E4; Sun, 2 Aug 2015 19:10:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id enz9nm66K_w3; Sun, 2 Aug 2015 19:10:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 878CE8481D; Sun, 2 Aug 2015 19:10:25 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 769861CE87B for ; Sun, 2 Aug 2015 19:10:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 705D28481D for ; Sun, 2 Aug 2015 19:10:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iLVqlmwirhwU for ; Sun, 2 Aug 2015 19:10:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1ACFA81BDB for ; Sun, 2 Aug 2015 19:10:22 +0000 (UTC) Received: by wibxm9 with SMTP id xm9so88769739wib.1 for ; Sun, 02 Aug 2015 12:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=kEFGhgIQX8OCdCNQrNoxMZRKyKR8w+bVkab0stBfg2Q=; b=Jtlu/KKtaXDC59iKK+AjnNQj2A6L+//dGV6Ji0v/B2cF/FAJ5AFI3sbGpC2HCzu7JP F1vxIiTy0hbZCJ6jbc5zg8gP8iO4083lv+TW1/S0y/nUgpxLwauuNEQiVCyunhFG9jTt nbAW4IDUZjHhniJ7/tGkGZAcAbJuzJUsUy5hE6mFW3ZSz5Ad2hk9OqKK1JFG/M2+5Xys rohJu6rbGo6qNCrYujJka+ZzwGx5y9jizY8VOaarn8dlgsB+sBQmlgOi0opsGWES4eYb CluxRE8wAFxFm7GRBkGDMpNNXj2HBv7NgnSG89xjTtWE2WAFLfS3oYv+rjj4I1MpR2Vu oDLQ== X-Received: by 10.194.58.71 with SMTP id o7mr27919704wjq.82.1438542620821; Sun, 02 Aug 2015 12:10:20 -0700 (PDT) Received: from bhfedora.localdomain ([82.15.84.251]) by smtp.gmail.com with ESMTPSA id dz4sm9544007wib.17.2015.08.02.12.10.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 12:10:20 -0700 (PDT) From: Brendan Heading To: buildroot@buildroot.org Date: Sun, 2 Aug 2015 20:10:14 +0100 Message-Id: <1438542614-2069-1-git-send-email-brendanheading@gmail.com> X-Mailer: git-send-email 2.4.3 Cc: Brendan Heading Subject: [Buildroot] [PATCH 1/1] package/arptables: fix musl compilation issues 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" Fixes http://autobuild.buildroot.net/results/841/841129b8f49df205e1dabc2c2a5be70fa266768b/ Backported two patches from upstream which had solved this problem. Signed-off-by: Brendan Heading --- package/arptables/0002-src-Use-stdint-types.patch | 129 +++++++++++++++++++++ .../0003-src-Remove-support-for-libc5.patch | 64 ++++++++++ 2 files changed, 193 insertions(+) create mode 100644 package/arptables/0002-src-Use-stdint-types.patch create mode 100644 package/arptables/0003-src-Remove-support-for-libc5.patch diff --git a/package/arptables/0002-src-Use-stdint-types.patch b/package/arptables/0002-src-Use-stdint-types.patch new file mode 100644 index 0000000..1c02697 --- /dev/null +++ b/package/arptables/0002-src-Use-stdint-types.patch @@ -0,0 +1,129 @@ +From 24957c135eaacd718f3c788285de33d64316b32e Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Sat, 16 May 2015 10:31:24 +0200 +Subject: [PATCH 1/2] src: Use stdint types + +Backport of upstream commit 047f37b1d5d865084a435fd7594b8c5c332ccb8d + +Upstream-status: backport +Signed-off-by: Felix Janda +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Brendan Heading +--- + arptables.c | 8 ++++---- + include/arptables.h | 3 ++- + include/libarptc/libarptc.h | 7 ++++--- + libarptc/libarptc.c | 4 ++-- + libarptc/libarptc_incl.c | 2 +- + 5 files changed, 13 insertions(+), 11 deletions(-) + +diff --git a/arptables.c b/arptables.c +index 5535ab2..6d1377f 100644 +--- a/arptables.c ++++ b/arptables.c +@@ -230,7 +230,7 @@ extern void dump_entries(const arptc_handle_t handle); + /etc/protocols */ + struct pprot { + char *name; +- u_int8_t num; ++ uint8_t num; + }; + + /* Primitive headers... */ +@@ -925,7 +925,7 @@ mask_to_dotted(const struct in_addr *mask) + { + int i; + static char buf[20]; +- u_int32_t maskaddr, bits; ++ uint32_t maskaddr, bits; + + maskaddr = ntohl(mask->s_addr); + +@@ -967,7 +967,7 @@ string_to_number(const char *s, unsigned int min, unsigned int max, + } + + static void +-set_option(unsigned int *options, unsigned int option, u_int16_t *invflg, ++set_option(unsigned int *options, unsigned int option, uint16_t *invflg, + int invert) + { + if (*options & option) +@@ -1107,7 +1107,7 @@ register_target(struct arptables_target *me) + } + + static void +-print_num(u_int64_t number, unsigned int format) ++print_num(uint64_t number, unsigned int format) + { + if (format & FMT_KILOMEGAGIGA) { + if (number > 99999) { +diff --git a/include/arptables.h b/include/arptables.h +index 820b664..e6a6ba6 100644 +--- a/include/arptables.h ++++ b/include/arptables.h +@@ -1,6 +1,7 @@ + #ifndef _ARPTABLES_USER_H + #define _ARPTABLES_USER_H + ++#include + #include "arptables_common.h" + #include "libarptc/libarptc.h" + +@@ -126,7 +127,7 @@ extern char *mask_to_dotted(const struct in_addr *mask); + + extern void parse_hostnetworkmask(const char *name, struct in_addr **addrpp, + struct in_addr *maskp, unsigned int *naddrs); +-extern u_int16_t parse_protocol(const char *s); ++extern uint16_t parse_protocol(const char *s); + + extern int do_command(int argc, char *argv[], char **table, + arptc_handle_t *handle); +diff --git a/include/libarptc/libarptc.h b/include/libarptc/libarptc.h +index e4f1175..76fbfab 100644 +--- a/include/libarptc/libarptc.h ++++ b/include/libarptc/libarptc.h +@@ -6,9 +6,10 @@ + #include + + #ifndef ARPT_MIN_ALIGN +-/* arpt_entry has pointers and u_int64_t's in it, so if you align to +- it, you'll also align to any crazy matches and targets someone +- might write */ ++/* arpt_entry has pointers and uint64_t's in it, so if you align to ++ * it, you'll also align to any crazy matches and targets someone ++ * might write. ++ */ + #define ARPT_MIN_ALIGN (__alignof__(struct arpt_entry)) + #endif + +diff --git a/libarptc/libarptc.c b/libarptc/libarptc.c +index 2dcaaef..701bae0 100644 +--- a/libarptc/libarptc.c ++++ b/libarptc/libarptc.c +@@ -256,8 +256,8 @@ unconditional(const struct arpt_arp *arp) + { + unsigned int i; + +- for (i = 0; i < sizeof(*arp)/sizeof(u_int32_t); i++) +- if (((u_int32_t *)arp)[i]) ++ for (i = 0; i < sizeof(*arp) / sizeof(uint32_t); i++) ++ if (((uint32_t *)arp)[i]) + return 0; + + return 1; +diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c +index 2fa3d43..b41fcb2 100644 +--- a/libarptc/libarptc_incl.c ++++ b/libarptc/libarptc_incl.c +@@ -1706,7 +1706,7 @@ TC_COMMIT(TC_HANDLE_T *handle) + /* Kernel will think that pointer should be 64-bits, and get + padding. So we accomodate here (assumption: alignment of + `counters' is on 64-bit boundary). */ +- u_int64_t *kernptr = (u_int64_t *)&newcounters->counters; ++ uint64_t *kernptr = (uint64_t *)&newcounters->counters; + if ((unsigned long)&newcounters->counters % 8 != 0) { + fprintf(stderr, + "counters alignment incorrect! Mail rusty!\n"); +-- +2.4.3 + diff --git a/package/arptables/0003-src-Remove-support-for-libc5.patch b/package/arptables/0003-src-Remove-support-for-libc5.patch new file mode 100644 index 0000000..15e893d --- /dev/null +++ b/package/arptables/0003-src-Remove-support-for-libc5.patch @@ -0,0 +1,64 @@ +From 5f1379ff68bfedb56309527bee266a591b27a19e Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Sat, 16 May 2015 10:31:41 +0200 +Subject: [PATCH 2/2] src: Remove support for libc5 + +Fixes compilation with musl libc + +Backport of upstream commit f4ab8f63f11a72f14687a6646d04ae1bae3fa45f +Upstream status: backport +Signed-off-by: Felix Janda +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Brendan Heading +--- + include/libarptc/arpt_kernel_headers.h | 12 ------------ + libarptc/libarptc.c | 4 ---- + 2 files changed, 16 deletions(-) + +diff --git a/include/libarptc/arpt_kernel_headers.h b/include/libarptc/arpt_kernel_headers.h +index 442cc54..140e999 100644 +--- a/include/libarptc/arpt_kernel_headers.h ++++ b/include/libarptc/arpt_kernel_headers.h +@@ -5,7 +5,6 @@ + + #include + +-#if defined(__GLIBC__) && __GLIBC__ == 2 + #include + #include + #include +@@ -14,16 +13,5 @@ + #include + #include + #include +-#else +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#endif + + #endif +diff --git a/libarptc/libarptc.c b/libarptc/libarptc.c +index 701bae0..9c5a5b0 100644 +--- a/libarptc/libarptc.c ++++ b/libarptc/libarptc.c +@@ -23,10 +23,6 @@ + #define inline + #endif + +-#if !defined(__GLIBC__) || (__GLIBC__ < 2) +-typedef unsigned int socklen_t; +-#endif +- + #include "libarptc/libarptc.h" + + #define IP_VERSION 4 +-- +2.4.3 +