lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] DHCP + mem_malloc / pbuf allocation from ram (not the p


From: Leon Woestenberg
Subject: Re: [lwip-users] DHCP + mem_malloc / pbuf allocation from ram (not the pool)
Date: Sun, 19 Sep 2004 13:40:08 +0200
User-agent: Mozilla Thunderbird 0.6 (X11/20040519)

Hello Eric,

Eric Shufro wrote:

When I start DHCP, I sends a discovery and then receives an offer, but it
never sends a request since when it tries to allocate memory for the dhcp
request, an error is returned: not enough memory.

The error's origin is in dhcp.h, function dhcp_create_request() when it
calls:

dhcp->p_out = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcp_msg), PBUF_RAM);


So sizeof(struct dhcp_msg) is eating the few bytes of left-over RAM? You could try to lay the structure in ROM, but that will only work if you do not fill in the "caddr" member
(i.e. leave it zero), so you cannot (re-)request an old lease then.

Also, the MAC address should be correct for each ROM dhcp_msg.

Also, see if you can reduce the dhcp_msg struct size in dhcp.h. It has space for so-called DHCP options and I might have gone a bit on the safe size to allow users to add
additional options (like recently, the DNS server option was added).

Hope any of these hints can help you out. Let us know if it did please!

Regards,

Leon.




reply via email to

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