aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2013-08-03 22:20:41 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2013-09-06 17:01:26 +0200
commitaa4f082f7526d39dac8e2ca64d192d858014ee10 (patch)
tree934626406772b7fbb750c9d0a46d893a09ce4f0a /net
parentdf7131623daf4823e087eb1128f6c1c351519774 (diff)
downloadqemu-aa4f082f7526d39dac8e2ca64d192d858014ee10.zip
qemu-aa4f082f7526d39dac8e2ca64d192d858014ee10.tar.gz
qemu-aa4f082f7526d39dac8e2ca64d192d858014ee10.tar.bz2
tap: Use numbered tap/tun devices on all *BSD OS's
The following patch simplifies the *BSD tap/tun code and makes use of numbered tap/tun interfaces on all *BSD OS's. NetBSD has a patch in their pkgsrc tree to make use of this feature and DragonFly also supports this as well. Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/tap-bsd.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index f61d580..90f8a02 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -44,8 +44,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
struct stat s;
#endif
-#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];
@@ -76,15 +74,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
dname, strerror(errno));
return -1;
}
-#else
- TFR(fd = open("/dev/tap", O_RDWR));
- if (fd < 0) {
- fprintf(stderr,
- "warning: could not open /dev/tap: no virtual network emulation: %s\n",
- strerror(errno));
- return -1;
- }
-#endif
#ifdef TAPGIFNAME
if (ioctl(fd, TAPGIFNAME, (void *)&ifr) < 0) {