qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [patch] slirp bootp, Request&Discover
@ 2004-05-12 15:30 Renzo Davoli
  2004-05-12 20:09 ` Fabrice Bellard
  0 siblings, 1 reply; 3+ messages in thread
From: Renzo Davoli @ 2004-05-12 15:30 UTC (permalink / raw)
  To: qemu-devel

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-05-13 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-12 15:30 [Qemu-devel] [patch] slirp bootp, Request&Discover Renzo Davoli
2004-05-12 20:09 ` Fabrice Bellard
2004-05-13 15:02   ` Renzo Davoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).