summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-10-07 15:07:25 +0100
committerRoy Marples <roy@marples.name>2019-10-07 15:07:25 +0100
commitf126cdfe98d99d083b497fefc2a2cf0eef4ef0b6 (patch)
tree0b38a11cec3f1393e3e38845fe4b93bf0039cce0
parent5c2d4a330d84cad0f058b6e454b59a351a3769ed (diff)
downloadparpd-f126cdfe98d99d083b497fefc2a2cf0eef4ef0b6.tar.xz
Linux: File compile warnings
-rw-r--r--src/lpf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lpf.c b/src/lpf.c
index 36cbd1c..cfd517b 100644
--- a/src/lpf.c
+++ b/src/lpf.c
@@ -27,6 +27,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <sys/uio.h>
#include <arpa/inet.h>
#include <net/if.h>
@@ -91,7 +92,7 @@ bpf_open_arp(struct interface *ifp)
memset(&su, 0, sizeof(su));
su.sll.sll_family = PF_PACKET;
su.sll.sll_protocol = htons(ETH_P_ALL);
- su.sll.sll_ifindex = if_nametoindex(ifp->ifname);
+ su.sll.sll_ifindex = (int)if_nametoindex(ifp->ifname);
if (bind(s, &su.sa, sizeof(su.sll)) == -1)
goto eexit;
@@ -140,7 +141,7 @@ bpf_read(struct interface *ifp, void *data, size_t len)
}
bytes -= ETHER_HDR_LEN;
if ((size_t)bytes > len)
- bytes = len;
- memcpy(data, ifp->buffer + ETHER_HDR_LEN, bytes);
+ bytes = (ssize_t)len;
+ memcpy(data, ifp->buffer + ETHER_HDR_LEN, (size_t)bytes);
return bytes;
}