Index: vl.c =================================================================== RCS file: /cvsroot/qemu/qemu/vl.c,v retrieving revision 1.59 diff -u -r1.59 vl.c --- vl.c 12 Apr 2004 20:39:28 -0000 1.59 +++ vl.c 15 Apr 2004 19:10:13 -0000 @@ -765,22 +765,29 @@ #else +#define MAX_TUNDEV_LEN 13 + static int tun_open(char *ifname, int ifname_size) { struct ifreq ifr; int fd, ret; + char tundev[MAX_TUNDEV_LEN]; - fd = open("/dev/net/tun", O_RDWR); - if (fd < 0) { - fprintf(stderr, "warning: could not open /dev/net/tun: no virtual network emulation\n"); + if ((fd = open("/dev/net/tun", O_RDWR)) >= 0) { + strncpy(tundev, "/dev/net/tun", MAX_TUNDEV_LEN); + } else if ((fd = open("/dev/tun", O_RDWR)) >= 0) { + strncpy(tundev, "/dev/tun", MAX_TUNDEV_LEN); + } else { + fprintf(stderr, "warning: could not open either /dev/net/tun or /dev/tun: no virtual network emulation\n"); return -1; } + memset(&ifr, 0, sizeof(ifr)); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; pstrcpy(ifr.ifr_name, IFNAMSIZ, "tun%d"); ret = ioctl(fd, TUNSETIFF, (void *) &ifr); if (ret != 0) { - fprintf(stderr, "warning: could not configure /dev/net/tun: no virtual network emulation\n"); + fprintf(stderr, "warning: could not configure %s: no virtual network emulation\n", tundev); close(fd); return -1; } Index: qemu-doc.texi =================================================================== RCS file: /cvsroot/qemu/qemu/qemu-doc.texi,v retrieving revision 1.25 diff -u -r1.25 qemu-doc.texi --- qemu-doc.texi 4 Apr 2004 15:21:17 -0000 1.25 +++ qemu-doc.texi 15 Apr 2004 19:10:13 -0000 @@ -552,7 +552,7 @@ properly @code{sudo} so that the command @code{ifconfig} contained in @file{qemu-ifup} can be executed as root. You must verify that your host kernel supports the TUN/TAP network interfaces: the device address@hidden/dev/net/tun} must be present. address@hidden/dev/net/tun} or @file{/dev/tun} must be present. When network is enabled, there is a virtual network connection between the host kernel and the emulated kernel. The emulated kernel is seen