bufs lost in TCP connection establishment


Rohit Grover
 

Jukka, Paul,

I find that uIP leaks one TX buf with every TCP connection due to incorrectly managed ref-counts. I'm able to setup and teardown the same number of connections as the value of CONFIG_IP_BUF_TX_SIZE.

The initial buf for the SYN packet gets its ref-count bumped to 2 (by tcpip_poll_tcp()), but then this count never goes down to 0.
It seems to me that when the tcpip_event is posted to process_thread_tcp() upon the sending of the SYN buf, the following code fragment

if (buf && uip_connected(buf)) {
struct net_context *context = user_data;
NET_DBG("Connection established context %p\n",
user_data);
context->connection_status = -EALREADY;
data = INT_TO_POINTER(TCP_WRITE_EVENT);
goto try_send;
}

is able is able to discover the transition to connected state, and cycles back to call handle_tcp_connection(); but the ref-count of SYN buf isn't decremented.

Can you help?

Thanks,
Rohit.

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Join devel@lists.zephyrproject.org to automatically receive all group messages.