提交 71f4effc 编写于 作者: A Alexander Graf 提交者: Anthony Liguori

Unbreak tap compilation on OS X

Currently compiling the tap sources breaks on Mac OS X. This is because of:

  1) tap-linux.h requiring Linux includes
  2) typos
  3) missing #includes

This patch adds what's necessary to compile tap happily on Mac OS X.
I haven't tested if using tap actually works, but I don't think that's a
major issue as that code was probably seriously untested before already.

I didn't split the patch, because it's only a few lines of code and
splitting is probably not worth the effort here.
Signed-off-by: NAlexander Graf <agraf@suse.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 195325a4
......@@ -23,7 +23,8 @@
*/
#include "net/tap.h"
#incude "qemu-common.h"
#include "qemu-common.h"
#include "sysemu.h"
#ifdef __NetBSD__
#include <net/if_tap.h>
......@@ -34,8 +35,9 @@
#else
#include <util.h>
#endif
#elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
#if defined (__GLIBC__) && defined (__FreeBSD_kernel__)
#include <freebsd/stdlib.h>
#endif
#if defined(__OpenBSD__)
#include <util.h>
......
......@@ -17,6 +17,8 @@
#define QEMU_TAP_H
#include <stdint.h>
#ifdef __LINUX__
#include <linux/ioctl.h>
/* Ioctl defines */
......@@ -26,6 +28,8 @@
#define TUNGETIFF _IOR('T', 210, unsigned int)
#define TUNSETSNDBUF _IOW('T', 212, int)
#endif
/* TUNSETIFF ifr flags */
#define IFF_TAP 0x0002
#define IFF_NO_PI 0x1000
......
......@@ -31,6 +31,7 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <net/if.h>
#include "net.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册