aboutsummaryrefslogtreecommitdiff
path: root/slirp
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-09-30 18:57:28 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-09-30 18:57:28 +0000
commitd981b88344e2c2b21683bea2af63a7bd519df21d (patch)
treec243da313d94af753e8a2c1eeb10c658311d2c51 /slirp
parent4a4883b84ddc2bd8b438faf35e019f9a59b960c8 (diff)
give a new address at DHCPREQUEST too (useful if the OS remembers its IP address
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1081 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp')
-rw-r--r--slirp/bootp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/slirp/bootp.c b/slirp/bootp.c
index 30cb05e956..8ae68af466 100644
--- a/slirp/bootp.c
+++ b/slirp/bootp.c
@@ -150,6 +150,7 @@ static void bootp_reply(struct bootp_t *bp)
memset(rbp, 0, sizeof(struct bootp_t));
if (dhcp_msg_type == DHCPDISCOVER) {
+ new_addr:
bc = get_new_addr(&daddr.sin_addr);
if (!bc) {
dprintf("no address left\n");
@@ -159,8 +160,9 @@ static void bootp_reply(struct bootp_t *bp)
} else {
bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr);
if (!bc) {
- dprintf("no address assigned\n");
- return;
+ /* if never assigned, behaves as if it was already
+ assigned (windows fix because it remembers its address) */
+ goto new_addr;
}
}
dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr));