Patchwork [1/2] net: support for bridged networking on Mac OS X

login
register
mail settings
Submitter Stefan Hajnoczi
Date May 24, 2013, 2:38 p.m.
Message ID <1369406295-20411-2-git-send-email-stefanha@redhat.com>
Download mbox | patch
Permalink /patch/246180/
State New
Headers show

Comments

Stefan Hajnoczi - May 24, 2013, 2:38 p.m.
From: Alasdair McLeay <alasdair.mcleay@me.com>

tun tap can be implemented on Mac OS X using
http://tuntaposx.sourceforge.net

It behaves in the same way as FreeBSD/OpenBSD implementations, but Qemu
needs a patch to use the OpenBS/FreeBSD code.

As per the patch listed in this forum thread:
http://forum.gns3.net/post17679.html#p17679

And also as used in the MacPorts installation:
https://trac.macports.org/browser/trunk/dports/emulators/qemu/files/patch-net-tap-interface.diff

Signed-off-by: Alasdair McLeay <alasdair.mcleay@me.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 net/tap-bsd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index bcdb268..f61d580 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -44,7 +44,8 @@  int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
     struct stat s;
 #endif
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+    defined(__OpenBSD__) || defined(__APPLE__)
     /* if no ifname is given, always start the search from tap0/tun0. */
     int i;
     char dname[100];