The check in qemu_can_send_packet() does not work correctly when using multiple nics. I found the problem when using -boot n and having more than one nic in use with the SLIRP networking. The qemu_can_send_packet() is only called as a part of the SLIRP networking check to see if there is a valid interface that packets can be sent on.

Using the attached patch, a pxe boot can be used with more than one nic, in particular using nics of different types. I also tested to make sure it still worked with a single nic as well.

Signed-off-by: Jason Wessel <[EMAIL PROTECTED]>

Jason.
---
 vl.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: qemu/vl.c
===================================================================
--- qemu.orig/vl.c
+++ qemu/vl.c
@@ -3195,11 +3195,11 @@ int qemu_can_send_packet(VLANClientState
 
     for(vc = vlan->first_client; vc != NULL; vc = vc->next) {
         if (vc != vc1) {
-            if (vc->fd_can_read && !vc->fd_can_read(vc->opaque))
-                return 0;
+            if (vc->fd_can_read && vc->fd_can_read(vc->opaque))
+                return 1;
         }
     }
-    return 1;
+    return 0;
 }
 
 void qemu_send_packet(VLANClientState *vc1, const uint8_t *buf, int size)

Reply via email to