|
From: | address@hidden |
Subject: | Re: [lwip-devel] Question about pbuf_free() in tcp_rst() |
Date: | Tue, 11 May 2010 18:25:32 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 |
Iordan Neshev wrote:
No, the driver only may call pbuf_free if it called pbuf_ref before. Every pbuf passed to ip_output (or udp_output and raw_output) has to be freed by the caller.tcp_out.c: void tcp_rst() { ... at the end, line 1220: /* Send output with hardcoded TTL since we have no access to the pcb */ ip_output(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP); pbuf_free(p); // ??? } Wasn't it the driver's responsibility to free the pbuf? If yes, should we replace pbuf_free(p) with LWIP_ASSERT("p is freed", ...) ?
Simon
[Prev in Thread] | Current Thread | [Next in Thread] |