qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch] slirp bootp, Request&Discover
Date: Wed, 12 May 2004 22:09:44 +0200	[thread overview]
Message-ID: <40A28488.5060201@bellard.org> (raw)
In-Reply-To: <20040512153048.GC7093@cs.unibo.it>

Strange. If a real DHCP server accepts that, then I agree to merge it. 
Otherwise, it may be bug in the NE2000 emulation.

Fabrice.

Renzo Davoli wrote:
> 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);
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://mail.nongnu.org/mailman/listinfo/qemu-devel
> 

  reply	other threads:[~2004-05-12 20:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-12 15:30 [Qemu-devel] [patch] slirp bootp, Request&Discover Renzo Davoli
2004-05-12 20:09 ` Fabrice Bellard [this message]
2004-05-13 15:02   ` Renzo Davoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40A28488.5060201@bellard.org \
    --to=fabrice@bellard.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).