Skip to contentSkip to conversation

NE2000 problem found

Qemu-devel Mike Nordell 3 participants 3 messages Jun 10, 2004 – Jun 26, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · 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

#1 lore raw
Quoted 9 lines · Mike Nordell
Quoted 3 lines · 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

Quoted 39 lines

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

(quoted diff) +6 -0
+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
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

#2 lore raw

Hi,

I added your patch. Thank you.

http://www.h7.dion.ne.jp/~qemu-win/download/qemu-0.5.5-slirp2.patch.gz
http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20040621-slirp2.patch.gz

Regards,
kazu

Quoted 8 lines · Leigh Dyer
Quoted 7 lines · Mike Nordell
Quoted 3 lines · 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

Quoted 13 lines
Quoted 2 lines

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

Quoted 1 line

It was that Windows cached the previous IP and tried to get that again

on

Quoted 1 line
Quoted 1 line

next reboot, using DHCPREQUEST. Unfortunately, that failed miserably

with

Quoted 1 line
Quoted 1 line

the CVS QEMU/slirp DHCP server. Basically, the code just dropped the

request

Quoted 4 lines
Quoted 4 lines

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

Quoted 3 lines
Quoted 3 lines

next reboot. :-)

I "fixed" it in a really Q&D way (probably wrong, and please don't hold

the

Quoted 1 line
Quoted 1 line

"goto" against me - I just wanted to display with as little code as

possible

Quoted 22 lines
Quoted 22 lines

how it could be fixed)

bootp_reply, in bootp.c

(quoted diff) +6 -0
+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