From: Fabrice Fontaine Date: Wed, 4 Dec 2019 19:11:44 +0000 (+0100) Subject: package/arptables: bump to version 0.0.5 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ade587665ba0dbe851986af905c7fce2e593a02;p=buildroot.git package/arptables: bump to version 0.0.5 - Update site to retrieve latest version - Remove first, second and third patches (already in version) - Use the new COPYING file as the license file - arptables binary is now named arptables-legacy since http://git.netfilter.org/arptables/commit/?id=28b22d55615447c94c5058e0aacec612ebc27f2a Signed-off-by: Fabrice Fontaine Signed-off-by: Thomas Petazzoni --- diff --git a/package/arptables/0001-Fix-musl-build-issue.patch b/package/arptables/0001-Fix-musl-build-issue.patch new file mode 100644 index 0000000000..e9419b0a96 --- /dev/null +++ b/package/arptables/0001-Fix-musl-build-issue.patch @@ -0,0 +1,71 @@ +From cbf84a0bc377c6a368d30571f37ebfab27784697 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Wed, 2 Dec 2015 04:57:33 +0100 +Subject: [PATCH 4/4] Fix musl build issue +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Due to clashes in the namespace between the Linux Kernel headers and the +netinet headers building arptables with the musl C library fails. + +Best advice from the musl developers is to not include both headers in a +userspace tool (see the thread on the musl mailing list [1], especially [2]). + +Since arptables only requires a few definitions from the Linux Kernel headers +we opt-out the clashing header files and define the needed definitions. + +[1] http://www.openwall.com/lists/musl/2012/10/09/1 +[2] http://www.openwall.com/lists/musl/2012/10/11/1 + +Signed-off-by: Jörg Krause +--- + extensions/arpt_CLASSIFY.c | 7 +++++++ + include/linux/netfilter_arp.h | 11 +++++++++++ + 2 files changed, 18 insertions(+) + +diff --git a/extensions/arpt_CLASSIFY.c b/extensions/arpt_CLASSIFY.c +index cb5770b..c58129f 100644 +--- a/extensions/arpt_CLASSIFY.c ++++ b/extensions/arpt_CLASSIFY.c +@@ -21,7 +21,14 @@ + #include + #include + #include ++ ++#ifdef __KERNEL__ + #include ++#else ++struct xt_classify_target_info { ++ uint32_t priority; ++}; ++#endif + + #define TC_H_MAJ_MASK (0xFFFF0000U) + #define TC_H_MIN_MASK (0x0000FFFFU) +diff --git a/include/linux/netfilter_arp.h b/include/linux/netfilter_arp.h +index 92bc6dd..2a63e82 100644 +--- a/include/linux/netfilter_arp.h ++++ b/include/linux/netfilter_arp.h +@@ -5,7 +5,18 @@ + * (C)2002 Rusty Russell IBM -- This code is GPL. + */ + ++#ifdef __KERNEL__ + #include ++#else ++/* Responses from hook functions. */ ++#define NF_DROP 0 ++#define NF_ACCEPT 1 ++#define NF_STOLEN 2 ++#define NF_QUEUE 3 ++#define NF_REPEAT 4 ++#define NF_STOP 5 ++#define NF_MAX_VERDICT NF_STOP ++#endif + + /* There is no PF_ARP. */ + #define NF_ARP 0 +-- +2.6.2 + diff --git a/package/arptables/0001-arptables-disable-dlfcn.h-include.patch b/package/arptables/0001-arptables-disable-dlfcn.h-include.patch deleted file mode 100644 index a5d56d22a6..0000000000 --- a/package/arptables/0001-arptables-disable-dlfcn.h-include.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 948a96d710f377fb0ed8d78c7fb85b299c80ef13 Mon Sep 17 00:00:00 2001 -From: Gustavo Zacarias -Date: Sat, 8 Nov 2014 10:12:54 -0300 -Subject: [PATCH] arptables: disable dlfcn.h include - -The relevant code is disabled in libarptc_incl.c so it's not required -and breaks the ability to build it in a pure-static toolchain. - -Status: sent upstream. - -Signed-off-by: Gustavo Zacarias ---- - arptables.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arptables.c b/arptables.c -index 64ac3aa..fe270bc 100644 ---- a/arptables.c -+++ b/arptables.c -@@ -35,7 +35,9 @@ - #include - #include - #include -+#if 0 - #include -+#endif - #include - #include - #include --- -2.0.4 - diff --git a/package/arptables/0002-src-Use-stdint-types.patch b/package/arptables/0002-src-Use-stdint-types.patch deleted file mode 100644 index 8a85e705d1..0000000000 --- a/package/arptables/0002-src-Use-stdint-types.patch +++ /dev/null @@ -1,134 +0,0 @@ -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 - -Please note that the backported patch does not include two changes -to arptables.h from the upstream - these modified lines added in commit -dbbe9f7de36aa3c7dd61dc89092c03f7902e474e which was committed after -the 0.0.4 release. - -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 deleted file mode 100644 index 15e893dd0c..0000000000 --- a/package/arptables/0003-src-Remove-support-for-libc5.patch +++ /dev/null @@ -1,64 +0,0 @@ -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 - diff --git a/package/arptables/0004-Fix-musl-build-issue.patch b/package/arptables/0004-Fix-musl-build-issue.patch deleted file mode 100644 index e9419b0a96..0000000000 --- a/package/arptables/0004-Fix-musl-build-issue.patch +++ /dev/null @@ -1,71 +0,0 @@ -From cbf84a0bc377c6a368d30571f37ebfab27784697 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=B6rg=20Krause?= -Date: Wed, 2 Dec 2015 04:57:33 +0100 -Subject: [PATCH 4/4] Fix musl build issue -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Due to clashes in the namespace between the Linux Kernel headers and the -netinet headers building arptables with the musl C library fails. - -Best advice from the musl developers is to not include both headers in a -userspace tool (see the thread on the musl mailing list [1], especially [2]). - -Since arptables only requires a few definitions from the Linux Kernel headers -we opt-out the clashing header files and define the needed definitions. - -[1] http://www.openwall.com/lists/musl/2012/10/09/1 -[2] http://www.openwall.com/lists/musl/2012/10/11/1 - -Signed-off-by: Jörg Krause ---- - extensions/arpt_CLASSIFY.c | 7 +++++++ - include/linux/netfilter_arp.h | 11 +++++++++++ - 2 files changed, 18 insertions(+) - -diff --git a/extensions/arpt_CLASSIFY.c b/extensions/arpt_CLASSIFY.c -index cb5770b..c58129f 100644 ---- a/extensions/arpt_CLASSIFY.c -+++ b/extensions/arpt_CLASSIFY.c -@@ -21,7 +21,14 @@ - #include - #include - #include -+ -+#ifdef __KERNEL__ - #include -+#else -+struct xt_classify_target_info { -+ uint32_t priority; -+}; -+#endif - - #define TC_H_MAJ_MASK (0xFFFF0000U) - #define TC_H_MIN_MASK (0x0000FFFFU) -diff --git a/include/linux/netfilter_arp.h b/include/linux/netfilter_arp.h -index 92bc6dd..2a63e82 100644 ---- a/include/linux/netfilter_arp.h -+++ b/include/linux/netfilter_arp.h -@@ -5,7 +5,18 @@ - * (C)2002 Rusty Russell IBM -- This code is GPL. - */ - -+#ifdef __KERNEL__ - #include -+#else -+/* Responses from hook functions. */ -+#define NF_DROP 0 -+#define NF_ACCEPT 1 -+#define NF_STOLEN 2 -+#define NF_QUEUE 3 -+#define NF_REPEAT 4 -+#define NF_STOP 5 -+#define NF_MAX_VERDICT NF_STOP -+#endif - - /* There is no PF_ARP. */ - #define NF_ARP 0 --- -2.6.2 - diff --git a/package/arptables/Config.in b/package/arptables/Config.in index 873e791e81..aeb7250a72 100644 --- a/package/arptables/Config.in +++ b/package/arptables/Config.in @@ -1,7 +1,12 @@ config BR2_PACKAGE_ARPTABLES - bool "arptables" + bool "arptables-legacy" depends on BR2_USE_MMU # needs fork() help - Tool to set up, maintain, and inspect the tables of ARP rules. + Legacy tool to set up, maintain, and inspect the tables of ARP + rules. - http://ebtables.sourceforge.net + A more uptodate client of the arptables tool is provided in + the iptables package. The new tool was formerly known as + arptables-compat. + + http://git.netfilter.org/arptables diff --git a/package/arptables/arptables.hash b/package/arptables/arptables.hash index 95b9997569..8366cea412 100644 --- a/package/arptables/arptables.hash +++ b/package/arptables/arptables.hash @@ -1,2 +1,5 @@ -# Locally calculated -sha256 277985e29ecd93bd759a58242cad0e02ba9d4a6e1b7795235e3b507661bc0049 arptables-v0.0.4.tar.gz +# From http://ftp.netfilter.org/pub/arptables/arptables-0.0.5.tar.gz.sha256sum +sha256 4f9a0656ce5c90868f551cd4deeb2d04f33899667e1fb2818b64e432fe8f629c arptables-0.0.5.tar.gz + +# Hash for license file +sha256 ebdb8ae564c952792017ec680e2edd30443642216eb9f8a3d8fa166c0cb628c1 COPYING diff --git a/package/arptables/arptables.mk b/package/arptables/arptables.mk index 257b636d62..320a33bb3c 100644 --- a/package/arptables/arptables.mk +++ b/package/arptables/arptables.mk @@ -4,10 +4,10 @@ # ################################################################################ -ARPTABLES_VERSION = 0.0.4 -ARPTABLES_SOURCE = arptables-v$(ARPTABLES_VERSION).tar.gz -ARPTABLES_SITE = http://downloads.sourceforge.net/project/ebtables/arptables/arptables-v$(ARPTABLES_VERSION) +ARPTABLES_VERSION = 0.0.5 +ARPTABLES_SITE = http://ftp.netfilter.org/pub/arptables ARPTABLES_LICENSE = GPL-2.0+ +ARPTABLES_LICENSE_FILES = COPYING define ARPTABLES_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \ @@ -15,7 +15,8 @@ define ARPTABLES_BUILD_CMDS endef define ARPTABLES_INSTALL_TARGET_CMDS - $(INSTALL) -m 755 -D $(@D)/arptables $(TARGET_DIR)/usr/sbin/arptables + $(INSTALL) -m 755 -D $(@D)/arptables-legacy \ + $(TARGET_DIR)/usr/sbin/arptables-legacy endef $(eval $(generic-package))