lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] dhcp bug fix


From: Leon Woestenberg
Subject: Re: [lwip-users] dhcp bug fix
Date: Thu, 25 Nov 2004 12:06:14 +0100

Hello Paul,

please make sure you are sending plain text to the mailing list and use
unified
diff patches (diff -Nur will do this).

> In dhcp_decline the netif is not configured so udp_send fails with ERR_RTE.
>
Could you deduce where this ERR_RTE was created?

udp_send() calls upon ip_route() which should return the default
interface
where the default gateway is on.

> This patch a copy of how the dhcp request is sent worked for me.
> 
> 682,683c682,683
> <     udp_connect(dhcp->pcb, &dhcp->server_ip_addr, DHCP_SERVER_PORT);
> <     udp_send(dhcp->pcb, dhcp->p_out);
> ---
> >     udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
> >     udp_sendto(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT);

The last line is indeed a good fix, as per RFC 2131 (DHCP) section
4.4.4, we
should broadcast DECLINE messages.

The first line connecting to the ANY address (0.0.0.0) seems strange,
but it
might be a legal or illegal workaround to the fact that udp_send()
returns
ERR_RTE as you say. 

I do not see the need for the connect now that we use sendto(). If you
remove
it completely, does it still work?

Thanks!

Regards,

Leon Woestenberg.




reply via email to

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