From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Baot1-0004Od-7b for qemu-devel@nongnu.org; Thu, 17 Jun 2004 00:52:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Baosz-0004Ng-JW for qemu-devel@nongnu.org; Thu, 17 Jun 2004 00:52:26 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Baosx-0004NW-Sp for qemu-devel@nongnu.org; Thu, 17 Jun 2004 00:52:25 -0400 Received: from [203.63.55.34] (helo=wallace.eclinic.com.au) by monty-python.gnu.org with smtp (Exim 4.34) id 1BaorL-0006x3-Fm for qemu-devel@nongnu.org; Thu, 17 Jun 2004 00:50:44 -0400 Subject: Re: [Qemu-devel] Re: NE2000 problem found From: Leigh Dyer In-Reply-To: <000b01c44eaa$bf37f9a0$0401a8c0@putte2k> References: <000b01c44eaa$bf37f9a0$0401a8c0@putte2k> Content-Type: text/plain Message-Id: <1087447810.14396.6.camel@shawn.local> Mime-Version: 1.0 Date: Thu, 17 Jun 2004 14:50:10 +1000 Content-Transfer-Encoding: 7bit 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 On Thu, 2004-06-10 at 07:21 +0200, Mike Nordell wrote: > I wrote: > > > It's also the thing that it seems only about every second time > > networking "works", to the extent the guest actually gets a > > DHCP address. > > I have now identified, and "fixed" this problem it seems. I have rebooted > four times, and the guest has gotten an IP every time. > I hadn't seen any more news on this, and I didn't see any patches committed to CVS to fix this, so I thought I'd mention that I too see this problem with Windows 2000 (it only gets an IP address from the DHCP server on every second boot), and that this fix seems to solve the problem for me as well. Thanks Leigh > It was that Windows cached the previous IP and tried to get that again on > next reboot, using DHCPREQUEST. Unfortunately, that failed miserably with > the CVS QEMU/slirp DHCP server. Basically, the code just dropped the request > and therefore the guest never got an IP. > > When Windows didn't get an IP, it noted so, and on the next reboot used > DHCPDISCOVER - which works - and so the merro-go-around starts over again on > next reboot. :-) > > I "fixed" it in a really Q&D way (probably wrong, and please don't hold the > "goto" against me - I just wanted to display with as little code as possible > how it could be fixed) > > bootp_reply, in bootp.c > > +try_again: > if (dhcp_msg_type == DHCPDISCOVER) { > ... > } else { > bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); > if (!bc) { > dprintf("no address assigned\n"); > +#if 1 > + dhcp_msg_type = DHCPDISCOVER; > + goto try_again; > +#else > return; > +#endif > } > > > /Mike > > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel