package/arptables: fix musl compilation issues
PATCH 1/1 package/arptables: fix musl compilation issues
Fixes http://autobuild.buildroot.net/results/841/841129b8f49df205e1dabc2c2a5be70fa266768b/
Backported two patches from upstream which had solved this problem.
--- 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
package/arptables/0002-src-Use-stdint-types.patch new file +129 -0
@@ -0,0 +1,129 @@ +From 24957c135eaacd718f3c788285de33d64316b32e Mon Sep 17 00:00:00 2001 +From: Felix Janda <[email protected]> +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 <[email protected]> +Signed-off-by: Pablo Neira Ayuso <[email protected]> +Signed-off-by: Brendan Heading <[email protected]> +--- + 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 <stdint.h> + #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 <linux/netfilter_arp/arp_tables.h> + + #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 +
package/arptables/0003-src-Remove-support-for-libc5.patch new file +64 -0
64 lines not on this page · raw message
Signature · 1 line
2.4.3
PATCH 1/1 package/arptables: fix musl compilation issues
Brendan, All,
On 2015-08-02 20:10 +0100, Brendan Heading spake thusly:
Quoted 27 lines
Fixes http://autobuild.buildroot.net/results/841/841129b8f49df205e1dabc2c2a5be70fa266768b/
Backported two patches from upstream which had solved this problem.
Signed-off-by Brendan Heading <[email protected]>--- 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.patchpackage/arptables/0002-src-Use-stdint-types.patch new file +9
-0@@ -0,0 +1,129 @@ +From 24957c135eaacd718f3c788285de33d64316b32e Mon Sep 17 00:00:00 2001 +From: Felix Janda <[email protected]> +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 <[email protected]>
package/arptables/0002-src-Use-stdint-types.patch line 19
Quoted 10 lines
package/arptables/0002-src-Use-stdint-types.patch new file +10
-0+Signed-off-by: Pablo Neira Ayuso <[email protected]> +Signed-off-by: Brendan Heading <[email protected]> +--- + 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(-) +
[--SNIP--]
Quoted 11 lines
package/arptables/0002-src-Use-stdint-types.patch new file +11
-0+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 <stdint.h> + #include "arptables_common.h" + #include "libarptc/libarptc.h"
package/arptables/0002-src-Use-stdint-types.patch line 80
Quoted 10 lines
package/arptables/0002-src-Use-stdint-types.patch new file +10
-0+ +@@ -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);
This is not exactly the patch that was applied by upstream:
http://git.netfilter.org/arptables/commit/?id=047f37b1d5d865084a435fd7594b8c5c332ccb8d
The patch you provide is missing two hunks which are upstream...
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 package/arptables: fix musl compilation issues
Quoted 4 lines
This is not exactly the patch that was applied by upstream:
http://git.netfilter.org/arptables/commit/?id=047f37b1d5d865084a435fd7594b8c5c332ccb8dThe patch you provide is missing two hunks which are upstream...
Yann,
That is correct - I had to rebase the patch against the 0.14 release (it did not apply cleanly).
Brendan
PATCH 1/1 package/arptables: fix musl compilation issues
Brendan, All,
On 2015-08-02 22:28 +0100, Brendan Heading spake thusly:
Quoted 5 lines
Quoted 3 lines
This is not exactly the patch that was applied by upstream:
http://git.netfilter.org/arptables/commit/?id=047f37b1d5d865084a435fd7594b8c5c332ccb8dThe patch you provide is missing two hunks which are upstream...
That is correct - I had to rebase the patch against the 0.14 release (it did not apply cleanly).
Ah, OK, you should have said so, then.
Care to resend with that comment added to the patch' commit log, plesae?
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 package/arptables: fix musl compilation issues
Quoted 3 lines
Ah, OK, you should have said so, then.
Care to resend with that comment added to the patch' commit log, plesae?
Sure. In my defence, I'd always assumed the term "backport" to mean the backported feature/fix plus whatever changes were needed to make it work on the backported version. But I appreciate that clarity is important. :)
regards
Brendan