Skip to contentSkip to conversation

Another bugfix: tun-fd option does not work

Qemu-devel Applied Renzo Davoli 2 participants 2 messages Apr 3, 2004 – Apr 4, 2004

lore
Share & tools
lore
#0 lore raw

There is a small bug in the current cvs: file vl.c.

Moving the ne2k interface descriptors initialization from before the getopt loop to just after it, the fd field get rewritten and the -tun-fd option ceases to work.

the patch is here attached.

ciao
renzo

vl.c renamed from vl.c.orig +3 -1
@@ -1728,6 +1728,9 @@
     macaddr[4] = 0x34;
     macaddr[5] = 0x56;
     
+    for(i = 0; i < MAX_NICS; i++) 
+        nd_table[i].fd = -1;
+    
     for(;;) {
         c = getopt_long_only(argc, argv, "hm:d:n:sp:L:", long_options, &long_index);
         if (c == -1)
@@ -1934,7 +1937,6 @@
     /* init host network redirectors */
     for(i = 0; i < MAX_NICS; i++) {
         NetDriverState *nd = &nd_table[i];
-        nd->fd = -1;
         /* init virtual mac address */
         nd->macaddr[0] = macaddr[0];
         nd->macaddr[1] = macaddr[1];
#1 lore raw
Quoted 7 lines · Renzo Davoli

There is a small bug in the current cvs: file vl.c.

Moving the ne2k interface descriptors initialization from before the getopt loop to just after it, the fd field get rewritten and the -tun-fd option ceases to work.

the patch is here attached.

Applied!

Fabrice.