package/igmpproxy: fix musl build
PATCH 1/1 package/igmpproxy: fix musl build
From: Bernd Kuhls <[email protected]>
Fixes
http://autobuild.buildroot.net/results/c6a/c6a6eec34cffb2c7876595b36fb8a01f475583f9/
http://autobuild.buildroot.net/results/943/9432748bf7b1e24db9fcb0a8cce6942fcdf6be5b/
http://autobuild.buildroot.net/results/083/083c61f43c2f1f0dec69d44583b447a0520933b7/
and many others
--- .../0002-Use-standard-unsigned-integer-types.patch | 213 +++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +213 -0
@@ -0,0 +1,213 @@ +Fix musl build + +Downloaded from: +https://github.com/alpinelinux/aports/blob/master/main/igmpproxy/0001-Use-standard-unsigned-integer-types.patch + +Patch was reported upstream: +http://sourceforge.net/p/igmpproxy/bugs/22/ + +Signed-off-by: Bernd Kuhls <[email protected]> + + +From ed3dff27f360239910310be6706fd54572398992 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <[email protected]> +Date: Mon, 3 Mar 2014 12:11:26 +0000 +Subject: [PATCH] Use standard unsigned integer types + +Use the stanard unsigned integer types instead of the non-standard +u_char, u_short and u_int. + +This fixes build with musl libc. + +(cherry picked from commit b914bcf882c6189be7a0ce6fceb34422372c3606) + +Conflicts: + src/igmp.c +--- + src/igmp.c | 4 ++-- + src/kern.c | 4 ++-- + src/lib.c | 10 +++++----- + src/os-dragonfly.h | 4 ++-- + src/os-freebsd.h | 4 ++-- + src/os-linux.h | 4 ++-- + src/os-netbsd.h | 4 ++-- + src/os-openbsd.h | 4 ++-- + 8 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/src/igmp.c b/src/igmp.c +index a0cd27d..92f37e7 100644 +--- a/src/igmp.c ++++ b/src/igmp.c +@@ -79,7 +79,7 @@ void initIgmp() { + /** + * Finds the textual name of the supplied IGMP request. + */ +-char *igmpPacketKind(u_int type, u_int code) { ++char *igmpPacketKind(unsigned int type, unsigned int code) { + static char unknown[20]; + + switch (type) { +@@ -226,7 +226,7 @@ void buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, i + igmp->igmp_code = code; + igmp->igmp_group.s_addr = group; + igmp->igmp_cksum = 0; +- igmp->igmp_cksum = inetChksum((u_short *)igmp, ++ igmp->igmp_cksum = inetChksum((unsigned short *)igmp, + IGMP_MINLEN + datalen); + } + +diff --git a/src/kern.c b/src/kern.c +index 2055636..12c613f 100644 +--- a/src/kern.c ++++ b/src/kern.c +@@ -82,7 +82,7 @@ void k_hdr_include(int hdrincl) { + + void k_set_ttl(int t) { + #ifndef RAW_OUTPUT_IS_RAW +- u_char ttl; ++ unsigned char ttl; + + ttl = t; + if (setsockopt(MRouterFD, IPPROTO_IP, IP_MULTICAST_TTL, +@@ -94,7 +94,7 @@ void k_set_ttl(int t) { + + + void k_set_loop(int l) { +- u_char loop; ++ unsigned char loop; + + loop = l; + if (setsockopt(MRouterFD, IPPROTO_IP, IP_MULTICAST_LOOP, +diff --git a/src/lib.c b/src/lib.c +index 70a730a..0eed9ce 100644 +--- a/src/lib.c ++++ b/src/lib.c +@@ -61,9 +61,9 @@ char *fmtInAdr( char *St, struct in_addr InAdr ) { + * Convert an IP address in u_long (network) format into a printable string. + */ + char *inetFmt(uint32_t addr, char *s) { +- register u_char *a; ++ register unsigned char *a; + +- a = (u_char *)&addr; ++ a = (unsigned char *)&addr; + sprintf(s, "%u.%u.%u.%u", a[0], a[1], a[2], a[3]); + return(s); + } +@@ -74,15 +74,15 @@ char *inetFmt(uint32_t addr, char *s) { + * string including the netmask as a number of bits. + */ + char *inetFmts(uint32_t addr, uint32_t mask, char *s) { +- register u_char *a, *m; ++ register unsigned char *a, *m; + int bits; + + if ((addr == 0) && (mask == 0)) { + sprintf(s, "default"); + return(s); + } +- a = (u_char *)&addr; +- m = (u_char *)&mask; ++ a = (unsigned char *)&addr; ++ m = (unsigned char *)&mask; + bits = 33 - ffs(ntohl(mask)); + + if (m[3] != 0) sprintf(s, "%u.%u.%u.%u/%d", a[0], a[1], a[2], a[3], +diff --git a/src/os-dragonfly.h b/src/os-dragonfly.h +index 735401c..189dfb2 100644 +--- a/src/os-dragonfly.h ++++ b/src/os-dragonfly.h +@@ -3,12 +3,12 @@ + #include <netinet/ip.h> + #include <netinet/igmp.h> + +-static inline u_short ip_data_len(const struct ip *ip) ++static inline unsigned short ip_data_len(const struct ip *ip) + { + return ip->ip_len; + } + +-static inline void ip_set_len(struct ip *ip, u_short len) ++static inline void ip_set_len(struct ip *ip, unsigned short len) + { + ip->ip_len = len; + } +diff --git a/src/os-freebsd.h b/src/os-freebsd.h +index ca01cc5..60b897c 100644 +--- a/src/os-freebsd.h ++++ b/src/os-freebsd.h +@@ -12,12 +12,12 @@ + #define IGMP_V2_LEAVE_GROUP IGMP_HOST_LEAVE_MESSAGE + #endif + +-static inline u_short ip_data_len(const struct ip *ip) ++static inline unsigned short ip_data_len(const struct ip *ip) + { + return ip->ip_len; + } + +-static inline void ip_set_len(struct ip *ip, u_short len) ++static inline void ip_set_len(struct ip *ip, unsigned short len) + { + ip->ip_len = len; + } +diff --git a/src/os-linux.h b/src/os-linux.h +index 7504b1f..6cdcdc7 100644 +--- a/src/os-linux.h ++++ b/src/os-linux.h +@@ -4,12 +4,12 @@ + #include <netinet/ip.h> + #include <netinet/igmp.h> + +-static inline u_short ip_data_len(const struct ip *ip) ++static inline unsigned short ip_data_len(const struct ip *ip) + { + return ntohs(ip->ip_len) - (ip->ip_hl << 2); + } + +-static inline void ip_set_len(struct ip *ip, u_short len) ++static inline void ip_set_len(struct ip *ip, unsigned short len) + { + ip->ip_len = htons(len); + } +diff --git a/src/os-netbsd.h b/src/os-netbsd.h +index 17bd5fa..22f74e5 100644 +--- a/src/os-netbsd.h ++++ b/src/os-netbsd.h +@@ -8,12 +8,12 @@ + #define IGMP_V2_MEMBERSHIP_REPORT IGMP_v2_HOST_MEMBERSHIP_REPORT + #define IGMP_V2_LEAVE_GROUP IGMP_HOST_LEAVE_MESSAGE + +-static inline u_short ip_data_len(const struct ip *ip) ++static inline unsigned short ip_data_len(const struct ip *ip) + { + return ip->ip_len; + } + +-static inline void ip_set_len(struct ip *ip, u_short len) ++static inline void ip_set_len(struct ip *ip, unsigned short len) + { + ip->ip_len = len; + } +diff --git a/src/os-openbsd.h b/src/os-openbsd.h +index 873e5fb..75ddf80 100644 +--- a/src/os-openbsd.h ++++ b/src/os-openbsd.h +@@ -10,12 +10,12 @@ + + #define INADDR_ALLRTRS_GROUP INADDR_ALLROUTERS_GROUP + +-static inline u_short ip_data_len(const struct ip *ip) ++static inline unsigned short ip_data_len(const struct ip *ip) + { + return ntohs(ip->ip_len) - (ip->ip_hl << 2); + } + +-static inline void ip_set_len(struct ip *ip, u_short len) ++static inline void ip_set_len(struct ip *ip, unsigned short len) + { + ip->ip_len = htons(len); + } +-- +1.9.0 +
Signature · 1 line
2.7.4
PATCH 1/1 package/igmpproxy: fix musl build
Hello,
Quoted 6 lines · Matt Weber
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +0
-0
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch line 9
Quoted 9 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +9
-0@@ -0,0 +1,213 @@ +Fix musl build + +Downloaded from: +https://github.com/alpinelinux/aports/blob/master/main/igmpproxy/0001-Use-standard-unsigned-integer-types.patch + +Patch was reported upstream: +http://sourceforge.net/p/igmpproxy/bugs/22/ + +Signed-off-by: Bernd Kuhls <[email protected]>
This should be below the commit log of the original patch, and the "Fix musl build" is not good. We don't care about "Fixing the musl build", we want to make the source code better, which has the consequence of fixing the musl build. So the original patch title "Use standard unsigned integer types" is good.
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch line 22
Quoted 11 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +11
-0+From ed3dff27f360239910310be6706fd54572398992 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <[email protected]> +Date: Mon, 3 Mar 2014 12:11:26 +0000 +Subject: [PATCH] Use standard unsigned integer types + +Use the stanard unsigned integer types instead of the non-standard +u_char, u_short and u_int. + +This fixes build with musl libc. + +(cherry picked from commit b914bcf882c6189be7a0ce6fceb34422372c3606)
From where is this commit b914bcf882c6189be7a0ce6fceb34422372c3606 coming? Upstream seems to be https://github.com/pali/igmpproxy, and I don't see any commit identified as b914bcf882c6189be7a0ce6fceb34422372c3606.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 package/igmpproxy: fix musl build
All,
Quoted 6 lines · Thomas Petazzoni
Hello,
Quoted 1 line · Matt Weber
diff --git
a/package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch b/package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch
Quoted 9 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch line 4
Quoted 9 lines
new file mode 100644
index 0000000..200bf23package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +4
-0@@ -0,0 +1,213 @@ +Fix musl build + +Downloaded from: +
Quoted 11 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch line 9
Quoted 5 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +5
-0+ +Patch was reported upstream: +http://sourceforge.net/p/igmpproxy/bugs/22/ + +Signed-off-by: Bernd Kuhls <[email protected]>This should be below the commit log of the original patch, and the "Fix musl build" is not good. We don't care about "Fixing the musl build", we want to make the source code better, which has the consequence of fixing the musl build. So the original patch title "Use standard unsigned integer types" is good.
Noted.
Quoted 17 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch line 22
Quoted 12 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +11
-0+From ed3dff27f360239910310be6706fd54572398992 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <[email protected]> +Date: Mon, 3 Mar 2014 12:11:26 +0000 +Subject: [PATCH] Use standard unsigned integer types + +Use the stanard unsigned integer types instead of the non-standard +u_char, u_short and u_int. + +This fixes build with musl libc. + +(cherry picked from commit b914bcf882c6189be7a0ce6fceb34422372c3606)From where is this commit
b914bcf882c6189be7a0ce6fceb34422372c3606coming? Upstream seems to be https://github.com/pali/igmpproxy, and I don't see any commit identified asb914bcf882c6189be7a0ce6fceb34422372c3606.
Sorry, bad assumption on my part about the original patch's origin being good. I'll open an upstream issue and work on getting it merged or at minimum something we can reference correctly.
Thanks
-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160518/c631dbe5/attachment.html>
PATCH 1/1 package/igmpproxy: fix musl build
Thomas,
Quoted 54 lines · Matthew Weber
All,
Quoted 6 lines · Thomas Petazzoni
Hello,
Quoted 1 line · Matt Weber
diff --git
a/package/igmpproxy/0002-Use-standard-unsigned-integer-types.patchb/package/igmpproxy/0002-Use-standard-unsigned-integer-types.patchQuoted 9 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch line 4
Quoted 9 lines
new file mode 100644
index 0000000..200bf23package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +4
-0@@ -0,0 +1,213 @@ +Fix musl build + +Downloaded from: +Quoted 11 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch line 9
Quoted 5 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +5
-0+ +Patch was reported upstream: +http://sourceforge.net/p/igmpproxy/bugs/22/ + +Signed-off-by: Bernd Kuhls <[email protected]>This should be below the commit log of the original patch, and the "Fix musl build" is not good. We don't care about "Fixing the musl build", we want to make the source code better, which has the consequence of fixing the musl build. So the original patch title "Use standard unsigned integer types" is good.
Noted.
Quoted 17 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch line 22
Quoted 12 lines
package/igmpproxy/0002-Use-standard-unsigned-integer-types.patch new file +11
-0+From ed3dff27f360239910310be6706fd54572398992 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <[email protected]> +Date: Mon, 3 Mar 2014 12:11:26 +0000 +Subject: [PATCH] Use standard unsigned integer types + +Use the stanard unsigned integer types instead of the non-standard +u_char, u_short and u_int. + +This fixes build with musl libc. + +(cherry picked from commit b914bcf882c6189be7a0ce6fceb34422372c3606)From where is this commit
b914bcf882c6189be7a0ce6fceb34422372c3606coming? Upstream seems to be https://github.com/pali/igmpproxy, and I don't see any commit identified asb914bcf882c6189be7a0ce6fceb34422372c3606.
Quoted 5 lines
Sorry, bad assumption on my part about the original patch's origin being good. I'll open an upstream issue and work on getting it merged or at minimum something we can reference correctly.
So if looks like b914bc,,,,, is the hash of the patch posted with the sourceforge issue ticket. There isn't a repository with the change that I could find.
https://sourceforge.net/p/igmpproxy/bugs/22/attachment/0001-Use-standard-unsigned-integer-types.patch
I'll update this comment to mention that the patch was based on the patch attached to the sourceforge issue ticket.
-- Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160518/bd3e7d65/attachment.html>