qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [patch] robust user-mode DHCP


From: John Coiner
Subject: [Qemu-devel] Re: [patch] robust user-mode DHCP
Date: Sun, 16 Oct 2005 22:02:18 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.11) Gecko/20050731



John R. Hogerhuis wrote:
I have no idea what 'frozen state' means in this context. Do you?

I guess not, since I suppose as soon as you really knew you would be in
a position to kill the fly with a fly swatter rather than running over
it with your car :-).

Not a criticism just a nudge... this sounds like a tiny bug somewhere
that deserves squashing rather than hiding.

Tell me about it :)

It was a tiny bug...

Windows does not like QEMU's DHCP server. Windows always issues DHCPDISCOVER and DHCPREQUEST packets in pairs: first the DHCPDISCOVER, followed by a DHCPREQUEST. The DHCPREQUEST is a sanity check. Windows wants the DHCP server to reply with the same IP for both requests, otherwise it does not consider the DHCP operation successful.

QEMU's DHCP server will reply with a new IP for each DHCPDISCOVER. However, for a DHCPREQUEST, it replies with the first IP it ever gave out on the first DHCPDISCOVER.

As a consequence, Windows' first DHCPDISCOVER/DHCPREQUEST pair succeeds, and every subsequent pair fails. That is why disabling and reenabling the NIC does not work, and why using the "ipconfig" program to renew the DHCP also does not work.

Here's a patch to fix this:

http://people.brandeis.edu/~jcoiner/qemu_idedma/qemu_dma_patch.html#dhcp

This patch also forces QEMU to reread the host's DNS info on any guest DHCP request, this is useful for users whose host DNS changes often.

What happens in the normal case to the software stack when a network
card is reset? Would all TCP connections that hadn't timed out yet time
out? That is, would the set of allocated sockets be freed back to the
pool? Slirp maintains context about every connection passing through it
since it is a proxy server. So if you reset it all those connections
would be dropped. So even if the socket was left open on the guest, it
would definitely be dropped  in slirp.

Yeah, all the stateful connections have some kind of timeout attached, after which they vaporize. So I'd agree that there's never a need to throw away one copy of slirp and set up another one.

Thanks.

-- John




reply via email to

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