]> xenbits.xensource.com Git - libvirt.git/commitdiff
Close fd's of persistent tap devices
authorSoren Hansen <soren@linux2go.dk>
Wed, 11 Aug 2010 21:51:41 +0000 (23:51 +0200)
committerEric Blake <eblake@redhat.com>
Sat, 14 Aug 2010 16:48:16 +0000 (10:48 -0600)
When passing a NULL tapfd argument to brAddTap, we need to close the fd
of the tap device. If we don't, libvirt will keep the fd open
indefinitely and renders the the guest unable to configure its side of
the tap device.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
src/util/bridge.c

index 7d0caaef7d07bcdbb0aade6cb880649e4e4c37e0..da62c5ec6dab0de18962d664af86897d9e9cff6b 100644 (file)
@@ -538,6 +538,8 @@ brAddTap(brControl *ctl,
         goto error;
     if (tapfd)
         *tapfd = fd;
+    else
+        close(fd);
     return 0;
 
  error: