qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: NE2000 problem found


From: Mike Nordell
Subject: [Qemu-devel] Re: NE2000 problem found
Date: Thu, 10 Jun 2004 07:21:11 +0200

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.

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]