python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / mkinitcpio-nfs-utils / patches / musl.patch
blobfa822cb05237cb1817c1114c26bc18eff5f58d24
1 From 9e6dd28c7b2d9649cc3fc3ea9effadcb29d233c5 Mon Sep 17 00:00:00 2001
2 From: Andrea Brancaleoni <miwaxe@gmail.com>
3 Date: Thu, 25 Jun 2015 18:01:23 +0200
4 Subject: [PATCH] musl
6 ---
7 ipconfig/packet.c | 27 +++++++++++++--------------
8 1 file changed, 13 insertions(+), 14 deletions(-)
10 diff --git a/ipconfig/packet.c b/ipconfig/packet.c
11 index 446073a..afedf9d 100644
12 --- a/ipconfig/packet.c
13 +++ b/ipconfig/packet.c
14 @@ -7,10 +7,9 @@
15 #include <stdlib.h>
16 #include <string.h>
17 #include <unistd.h>
18 -#include <net/if_packet.h>
19 +#include <linux/if_packet.h>
20 #include <netinet/if_ether.h>
21 #include <netinet/in.h>
22 -#include <netpacket/packet.h>
23 #include <asm/byteorder.h>
24 #include <arpa/inet.h>
25 #include <netinet/ip.h>
26 @@ -92,10 +91,10 @@ static struct header ipudp_hdrs = {
27 .daddr = INADDR_BROADCAST,
29 .udp = {
30 - .source = __constant_htons(LOCAL_PORT),
31 - .dest = __constant_htons(REMOTE_PORT),
32 - .len = 0,
33 - .check = 0,
34 + .uh_sport = __constant_htons(LOCAL_PORT),
35 + .uh_dport = __constant_htons(REMOTE_PORT),
36 + .uh_ulen = 0,
37 + .uh_sum = 0,
41 @@ -127,8 +126,8 @@ int packet_send(struct netdev *dev, struct iovec *iov, int iov_len)
42 msg.msg_flags = 0;
44 if (cfg_local_port != LOCAL_PORT) {
45 - ipudp_hdrs.udp.source = htons(cfg_local_port);
46 - ipudp_hdrs.udp.dest = htons(cfg_remote_port);
47 + ipudp_hdrs.udp.uh_sport = htons(cfg_local_port);
48 + ipudp_hdrs.udp.uh_dport = htons(cfg_remote_port);
51 dprintf("\n udp src %d dst %d", ntohs(ipudp_hdrs.udp.source),
52 @@ -159,7 +158,7 @@ int packet_send(struct netdev *dev, struct iovec *iov, int iov_len)
53 ipudp_hdrs.ip.check = ip_checksum((uint16_t *) &ipudp_hdrs.ip,
54 ipudp_hdrs.ip.ihl);
56 - ipudp_hdrs.udp.len = htons(len - sizeof(struct iphdr));
57 + ipudp_hdrs.udp.uh_ulen = htons(len - sizeof(struct iphdr));
59 dprintf("\n bytes %d\n", len);
61 @@ -243,14 +242,14 @@ int packet_recv(struct netdev *dev, struct iovec *iov, int iov_len)
63 ret -= 4 * ip->ihl;
65 - dprintf("\n udp src %d dst %d ", ntohs(udp->source),
66 - ntohs(udp->dest));
67 + dprintf("\n udp src %d dst %d ", ntohs(udp->uh_sport),
68 + ntohs(udp->uh_dport));
70 - if (udp->source != htons(cfg_remote_port) ||
71 - udp->dest != htons(cfg_local_port))
72 + if (udp->uh_sport != htons(cfg_remote_port) ||
73 + udp->uh_dport != htons(cfg_local_port))
74 goto free_pkt;
76 - if (ntohs(udp->len) > ret)
77 + if (ntohs(udp->uh_ulen) > ret)
78 goto free_pkt;
80 ret -= sizeof(struct udphdr);
82 2.4.4