Index: configure
===================================================================
--- configure.orig	2006-07-22 20:23:34.000000000 +0300
+++ configure	2006-11-04 21:08:25.000000000 +0200
@@ -108,6 +108,12 @@ CFLAGS="-O2 -mno-cygwin"
 MINGW32*)
 mingw32="yes"
 ;;
+GNU/kFreeBSD)
+oss="yes"
+if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
+    kqemu="yes"
+fi
+;;
 FreeBSD)
 bsd="yes"
 oss="yes"
Index: vl.c
===================================================================
--- vl.c.orig	2006-11-04 21:02:57.000000000 +0200
+++ vl.c	2006-11-04 21:08:26.000000000 +0200
@@ -46,6 +46,8 @@
 #ifndef __APPLE__
 #include <libutil.h>
 #endif
+#elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
+#include <freebsd/stdlib.h>
 #else
 #ifndef __sun__
 #include <linux/if.h>
@@ -3026,7 +3028,7 @@ static TAPState *net_tap_fd_init(VLANSta
     return s;
 }
 
-#ifdef _BSD
+#if defined (_BSD) || defined (__FreeBSD_kernel__)
 static int tap_open(char *ifname, int ifname_size)
 {
     int fd;
