From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BO045-0006X4-3t for qemu-devel@nongnu.org; Wed, 12 May 2004 16:10:53 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BO02f-0005wj-9c for qemu-devel@nongnu.org; Wed, 12 May 2004 16:09:58 -0400 Received: from [193.252.22.27] (helo=mwinf0401.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BO00s-00056y-N4 for qemu-devel@nongnu.org; Wed, 12 May 2004 16:07:34 -0400 Received: from bellard.org (ATuileries-112-1-2-143.w80-14.abo.wanadoo.fr [80.14.188.143]) by mwinf0401.wanadoo.fr (SMTP Server) with ESMTP id 33D815802571 for ; Wed, 12 May 2004 22:07:30 +0200 (CEST) Message-ID: <40A28488.5060201@bellard.org> Date: Wed, 12 May 2004 22:09:44 +0200 From: Fabrice Bellard MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch] slirp bootp, Request&Discover References: <20040512153048.GC7093@cs.unibo.it> In-Reply-To: <20040512153048.GC7093@cs.unibo.it> Content-Type: text/plain; charset=us-ascii; format=flowed 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 Strange. If a real DHCP server accepts that, then I agree to merge it. Otherwise, it may be bug in the NE2000 emulation. Fabrice. Renzo Davoli wrote: > I have done some tests with Win98. > > Sometimes it starts asking for an address with a DHCPdiscover > sometimes with a DHCPrequest. > In the latter case using the current cvs of bootp.c there is no answer > as there is no MAC address registered yet. > > Maybe it is a workaround (although a working workaround ;-) but I > propose to manage a DHCPrequest with no registered MAC address as it > were a DHCPdiscover. > > The patch is here enclosed. > > ciao > renzo > > ----------- > --- bootp.cvs.c 2004-05-04 14:20:25.000000000 +0200 > +++ bootp.c 2004-05-12 17:19:50.000000000 +0200 > @@ -149,20 +149,18 @@ > m->m_data += sizeof(struct udpiphdr); > memset(rbp, 0, sizeof(struct bootp_t)); > > - if (dhcp_msg_type == DHCPDISCOVER) { > + bc=NULL; > + if (dhcp_msg_type == DHCPREQUEST) > + bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); > + if (!bc) { > bc = get_new_addr(&daddr.sin_addr); > if (!bc) { > dprintf("no address left\n"); > return; > } > memcpy(bc->macaddr, client_ethaddr, 6); > - } else { > - bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); > - if (!bc) { > - dprintf("no address assigned\n"); > - return; > - } > } > + > dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr)); > > saddr.sin_addr.s_addr = htonl(ntohl(special_addr.s_addr) | > CTL_ALIAS); > > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://mail.nongnu.org/mailman/listinfo/qemu-devel >