net: tap-linux: Fix unhelpful error message
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 14 Oct 2011 18:05:10 +0000 (15:05 -0300)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tue, 1 Nov 2011 06:23:48 +0000 (06:23 +0000)
commitdedee2be6ec4764d1ec47b2af6399c064ce7cad7
treee4ce2cb907c3da1841a48a3e092354c388f33cbb
parent289c73abc51dadcf59107cadb1a4e7042ea7efd8
net: tap-linux: Fix unhelpful error message

I'm getting:

    could not configure /dev/net/tun (tap%d): Operation not permitted

When the ioctl() fails, ifr.ifr_name will most likely not be overwritten.
So we better only use it when ifname contains a string.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
net/tap-linux.c