All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] fix dhcp with multiple nics an SLIRP
Date: Fri, 29 Jun 2007 07:52:46 -0500	[thread overview]
Message-ID: <4685009E.8040300@windriver.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

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 <jason.wessel@windriver.com>

Jason.

[-- Attachment #2: slirp_fix_multiple_dhcp.patch --]
[-- Type: text/x-patch, Size: 661 bytes --]

---
 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	other threads:[~2007-06-29 12:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4685009E.8040300@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.