void-packages/srcpkgs/mkinitcpio-nfs-utils/patches/musl.patch

84 lines
2.4 KiB
Diff

From 9e6dd28c7b2d9649cc3fc3ea9effadcb29d233c5 Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Thu, 25 Jun 2015 18:01:23 +0200
Subject: [PATCH] musl
---
ipconfig/packet.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/ipconfig/packet.c b/ipconfig/packet.c
index 446073a..afedf9d 100644
--- a/ipconfig/packet.c
+++ b/ipconfig/packet.c
@@ -7,10 +7,9 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <net/if_packet.h>
+#include <linux/if_packet.h>
#include <netinet/if_ether.h>
#include <netinet/in.h>
-#include <netpacket/packet.h>
#include <asm/byteorder.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
@@ -92,10 +91,10 @@ static struct header ipudp_hdrs = {
.daddr = INADDR_BROADCAST,
},
.udp = {
- .source = __constant_htons(LOCAL_PORT),
- .dest = __constant_htons(REMOTE_PORT),
- .len = 0,
- .check = 0,
+ .uh_sport = __constant_htons(LOCAL_PORT),
+ .uh_dport = __constant_htons(REMOTE_PORT),
+ .uh_ulen = 0,
+ .uh_sum = 0,
},
};
@@ -127,8 +126,8 @@ int packet_send(struct netdev *dev, struct iovec *iov, int iov_len)
msg.msg_flags = 0;
if (cfg_local_port != LOCAL_PORT) {
- ipudp_hdrs.udp.source = htons(cfg_local_port);
- ipudp_hdrs.udp.dest = htons(cfg_remote_port);
+ ipudp_hdrs.udp.uh_sport = htons(cfg_local_port);
+ ipudp_hdrs.udp.uh_dport = htons(cfg_remote_port);
}
dprintf("\n udp src %d dst %d", ntohs(ipudp_hdrs.udp.source),
@@ -159,7 +158,7 @@ int packet_send(struct netdev *dev, struct iovec *iov, int iov_len)
ipudp_hdrs.ip.check = ip_checksum((uint16_t *) &ipudp_hdrs.ip,
ipudp_hdrs.ip.ihl);
- ipudp_hdrs.udp.len = htons(len - sizeof(struct iphdr));
+ ipudp_hdrs.udp.uh_ulen = htons(len - sizeof(struct iphdr));
dprintf("\n bytes %d\n", len);
@@ -243,14 +242,14 @@ int packet_recv(struct netdev *dev, struct iovec *iov, int iov_len)
ret -= 4 * ip->ihl;
- dprintf("\n udp src %d dst %d ", ntohs(udp->source),
- ntohs(udp->dest));
+ dprintf("\n udp src %d dst %d ", ntohs(udp->uh_sport),
+ ntohs(udp->uh_dport));
- if (udp->source != htons(cfg_remote_port) ||
- udp->dest != htons(cfg_local_port))
+ if (udp->uh_sport != htons(cfg_remote_port) ||
+ udp->uh_dport != htons(cfg_local_port))
goto free_pkt;
- if (ntohs(udp->len) > ret)
+ if (ntohs(udp->uh_ulen) > ret)
goto free_pkt;
ret -= sizeof(struct udphdr);
--
2.4.4