summary refs log tree commit diff stats
path: root/net/tap-linux.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-11-01 13:06:17 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-11-01 13:06:17 -0500
commit596235300608575ece1828b12a5faf32ebfee3fc (patch)
treed8f458d70ddceae02c9e6e027d68910a91c3c16b /net/tap-linux.c
parent90ea59fe7d121c722e1b44cb9bc0fad1ade73686 (diff)
parent0ce6a434176e274a7e86bcaa268542c5cc402696 (diff)
downloadfocaccia-qemu-596235300608575ece1828b12a5faf32ebfee3fc.tar.gz
focaccia-qemu-596235300608575ece1828b12a5faf32ebfee3fc.zip
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Diffstat (limited to 'net/tap-linux.c')
-rw-r--r--net/tap-linux.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/tap-linux.c b/net/tap-linux.c
index ff8cad0ea0..41d581b734 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -73,7 +73,11 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required
         pstrcpy(ifr.ifr_name, IFNAMSIZ, "tap%d");
     ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
     if (ret != 0) {
-        error_report("could not configure %s (%s): %m", PATH_NET_TUN, ifr.ifr_name);
+        if (ifname[0] != '\0') {
+            error_report("could not configure %s (%s): %m", PATH_NET_TUN, ifr.ifr_name);
+        } else {
+            error_report("could not configure %s: %m", PATH_NET_TUN);
+        }
         close(fd);
         return -1;
     }