From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I4FxF-0005vs-Ep for qemu-devel@nongnu.org; Fri, 29 Jun 2007 08:52:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I4FxD-0005um-1F for qemu-devel@nongnu.org; Fri, 29 Jun 2007 08:52:04 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4FxC-0005uc-5X for qemu-devel@nongnu.org; Fri, 29 Jun 2007 08:52:02 -0400 Received: from mail.windriver.com ([147.11.1.11] helo=mail.wrs.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I4FxB-0007Ob-Hd for qemu-devel@nongnu.org; Fri, 29 Jun 2007 08:52:01 -0400 Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144]) by mail.wrs.com (8.13.6/8.13.6) with ESMTP id l5TCq0nP028391 for ; Fri, 29 Jun 2007 05:52:00 -0700 (PDT) Message-ID: <4685009E.8040300@windriver.com> Date: Fri, 29 Jun 2007 07:52:46 -0500 From: Jason Wessel MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040207070606050100040002" Subject: [Qemu-devel] [PATCH] fix dhcp with multiple nics an SLIRP Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------040207070606050100040002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------040207070606050100040002 Content-Type: text/x-patch; name="slirp_fix_multiple_dhcp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="slirp_fix_multiple_dhcp.patch" --- 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) --------------040207070606050100040002--