aboutsummaryrefslogtreecommitdiffstats
path: root/community/paris-traceroute/in6-union.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/paris-traceroute/in6-union.patch')
-rw-r--r--community/paris-traceroute/in6-union.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/community/paris-traceroute/in6-union.patch b/community/paris-traceroute/in6-union.patch
new file mode 100644
index 0000000000..02eedc5037
--- /dev/null
+++ b/community/paris-traceroute/in6-union.patch
@@ -0,0 +1,56 @@
+Fix various socket header usages on MUSL.
+
+Upstream-status: Cleanup needed
+--- libparistraceroute-0.93.orig/libparistraceroute/protocols/ipv6.c
++++ libparistraceroute-0.93/libparistraceroute/protocols/ipv6.c
+@@ -186,7 +186,7 @@
+ // If at least one byte of the src_ip is not null, we suppose
+ // that the src_ip has been set...
+ for (i = 0; i < 8 && !do_update_src_ip; i++) {
+- if (iph->ip6_src.__in6_u.__u6_addr16[i] != 0) {
++ if (iph->ip6_src.__in6_union.__s6_addr16[i] != 0) {
+ do_update_src_ip = false;
+ break;
+ }
+--- libparistraceroute-0.93.orig/libparistraceroute/protocols/tcp.c
++++ libparistraceroute-0.93/libparistraceroute/protocols/tcp.c
+@@ -77,6 +77,7 @@
+ #define TCP_FIELD_OPTIONS "options" // if data offset > 5, padded at the end with 0 if necessary
+
+ // BSD/Linux abstraction
++#define __FAVOR_BSD
+ #ifdef __FAVOR_BSD
+ # define SRC_PORT th_sport
+ # define DST_PORT th_dport
+@@ -308,10 +309,10 @@
+ memcpy(psh + size_ip, tcp_segment, size_tcp);
+
+ // Overrides the TCP checksum in psh with zeros
+- memset(psh + size_ip + offsetof(struct tcphdr, check), 0, sizeof(uint16_t));
++ memset(psh + size_ip + offsetof(struct tcphdr, CHECKSUM), 0, sizeof(uint16_t));
+
+ // Compute the checksum
+- tcp_header->check = csum((const uint16_t *) psh, size_psh);
++ tcp_header->CHECKSUM = csum((const uint16_t *) psh, size_psh);
+ free(psh);
+ return true;
+ }
+--- libparistraceroute-0.93.orig/libparistraceroute/protocols/udp.c
++++ libparistraceroute-0.93/libparistraceroute/protocols/udp.c
+@@ -32,6 +32,7 @@
+ // XXX UDP parsing missing
+
+ // BSD/Linux abstraction
++#define __FAVOR_BSD
+ #ifdef __FAVOR_BSD
+ # define SRC_PORT uh_sport
+ # define DST_PORT uh_dport
+@@ -147,7 +148,7 @@
+ memset(psh + size_ip + offsetof(struct udphdr, CHECKSUM), 0, sizeof(uint16_t));
+
+ // Compute the checksum
+- udp_header->check = csum((const uint16_t *) psh, size_psh);
++ udp_header->CHECKSUM = csum((const uint16_t *) psh, size_psh);
+ free(psh);
+ return true;
+ }