]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile on FreeBSD
authorRoy Marples <roy@marples.name>
Sun, 17 Feb 2013 16:12:54 +0000 (16:12 +0000)
committerRoy Marples <roy@marples.name>
Sun, 17 Feb 2013 16:12:54 +0000 (16:12 +0000)
bpf.c
dhcp.c
ipv4.c

diff --git a/bpf.c b/bpf.c
index ab7bdf548b784504b138a3225bcc0a3c20c3831e..835c353ad5e767e1622be6a4e199af5ecc67210a 100644 (file)
--- a/bpf.c
+++ b/bpf.c
@@ -67,7 +67,9 @@ ipv4_opensocket(struct interface *ifp, int protocol)
        char *device;
        int n = 0;
 
-       device = xmalloc(sizeof(char) * PATH_MAX);
+       device = malloc(sizeof(char) * PATH_MAX);
+       if (device == NULL)
+               return -1;
        do {
                snprintf(device, PATH_MAX, "/dev/bpf%d", n++);
                fd = open(device, O_RDWR | O_NONBLOCK);
diff --git a/dhcp.c b/dhcp.c
index b845ed8143fdfd66ba33bb11400e7bf200494bcb..8ec514002b9d10fc9fd0cd2716aba99fd10c18ee 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -25,8 +25,7 @@
  * SUCH DAMAGE.
  */
 
-#include <arpa/inet.h>
-#include <net/route.h>
+#include <sys/socket.h>
 #include <sys/stat.h>
 
 #ifdef __linux__
@@ -34,6 +33,9 @@
 #  include <linux/rtnetlink.h>
 #endif
 
+#include <arpa/inet.h>
+#include <net/route.h>
+
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
diff --git a/ipv4.c b/ipv4.c
index 10b79e7a78ee30023a29420fe3f37d4bb3f61ecc..f9e43d14a246c0ebefee47e061457f2fdaa15675 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -25,6 +25,9 @@
  * SUCH DAMAGE.
  */
 
+#include <sys/socket.h>
+#include <sys/types.h>
+
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <net/route.h>