]> git.proxmox.com Git - qemu.git/commitdiff
net: support for bridged networking on Mac OS X
authorAlasdair McLeay <alasdair.mcleay@me.com>
Thu, 9 May 2013 18:44:30 +0000 (19:44 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 24 May 2013 14:33:48 +0000 (16:33 +0200)
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

index bcdb2682b56b7ce3cac107c5043d7b92410bd854..f61d5809634e240c996cc3b8d25cf30629103b9a 100644 (file)
@@ -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];