render / rpms / qemu

Forked from rpms/qemu 7 months ago
Clone

Blame 0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch

298366
From 6bbb9d8100c90deb4843bfa3cf36e75b843c495b Mon Sep 17 00:00:00 2001
298366
From: Brad Smith <brad@comstyle.com>
298366
Date: Sat, 3 Aug 2013 22:20:41 -0400
298366
Subject: [PATCH] tap: Use numbered tap/tun devices on all *BSD OS's
298366
298366
The following patch simplifies the *BSD tap/tun code and makes use of numbered
298366
tap/tun interfaces on all *BSD OS's. NetBSD has a patch in their pkgsrc tree
298366
to make use of this feature and DragonFly also supports this as well.
298366
298366
Signed-off-by: Brad Smith <brad@comstyle.com>
298366
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
298366
(cherry picked from commit aa4f082f7526d39dac8e2ca64d192d858014ee10)
298366
298366
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
298366
---
298366
 net/tap-bsd.c | 11 -----------
298366
 1 file changed, 11 deletions(-)
298366
298366
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
298366
index f61d580..90f8a02 100644
298366
--- a/net/tap-bsd.c
298366
+++ b/net/tap-bsd.c
298366
@@ -44,8 +44,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
298366
     struct stat s;
298366
 #endif
298366
 
298366
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
298366
-    defined(__OpenBSD__) || defined(__APPLE__)
298366
     /* if no ifname is given, always start the search from tap0/tun0. */
298366
     int i;
298366
     char dname[100];
298366
@@ -76,15 +74,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
298366
                    dname, strerror(errno));
298366
         return -1;
298366
     }
298366
-#else
298366
-    TFR(fd = open("/dev/tap", O_RDWR));
298366
-    if (fd < 0) {
298366
-        fprintf(stderr,
298366
-            "warning: could not open /dev/tap: no virtual network emulation: %s\n",
298366
-            strerror(errno));
298366
-        return -1;
298366
-    }
298366
-#endif
298366
 
298366
 #ifdef TAPGIFNAME
298366
     if (ioctl(fd, TAPGIFNAME, (void *)&ifr) < 0) {