summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Jones <thj@freebsd.org>2024-01-30 09:06:47 +0000
committerDamjan Marion <dmarion@0xa5.net>2024-02-18 15:58:01 +0000
commit61b4efc4dae3f60265ed2b6d8bdcad84b1c4e1cb (patch)
tree5b5313097aff8fb3680701c83b81063ef8e91259
parent6ce1e930e87938d9350da5ed7652cf64fbc82e6d (diff)
vnet: Provide platform specific if_tap headers
Type: improvement Change-Id: Ia5cec0afc7f929491e495bb337493e64f752d75f Signed-off-by: Tom Jones <thj@freebsd.org>
-rw-r--r--src/vnet/devices/virtio/node.c4
-rw-r--r--src/vnet/devices/virtio/virtio.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/node.c b/src/vnet/devices/virtio/node.c
index b58c75360e3..b329fdd7719 100644
--- a/src/vnet/devices/virtio/node.c
+++ b/src/vnet/devices/virtio/node.c
@@ -19,7 +19,11 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <net/if.h>
+#ifdef __linux__
#include <linux/if_tun.h>
+#elif __FreeBSD__
+#include <net/if_tun.h>
+#endif /* __linux */
#include <sys/ioctl.h>
#include <sys/eventfd.h>
diff --git a/src/vnet/devices/virtio/virtio.c b/src/vnet/devices/virtio/virtio.c
index 2d393656b39..d2302fa1dc4 100644
--- a/src/vnet/devices/virtio/virtio.c
+++ b/src/vnet/devices/virtio/virtio.c
@@ -19,7 +19,11 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <net/if.h>
+#ifdef __linux__
#include <linux/if_tun.h>
+#elif __FreeBSD__
+#include <net/if_tun.h>
+#endif /* __linux__ */
#include <sys/ioctl.h>
#include <sys/eventfd.h>