I have a question about netbuf usage and the BSD socket implementation. From looking at netbuf.c and sockets.c, it appears there are APIs in netbuf.c for allocating netbufs from a netbuf memory pool. This APIs are netbuf_new() and netbuf_delete(). The sockets layer uses a netbuf in lwip_sendto(), with either a subsequent call to netbuf_alloc() or netbuf_ref(), but not a netbuf from netbuf_new(), instead a static struct on the stack.
What's the intended use of the netbuf pool? Should the socket layer ever use that? Further, I've noticed some of the netbuf APIs assume a dynamic netbuf, e.g. netbuf_chain() calls memp_free on the tail netbuf (which would be incorrect with a static netbuf).
http://lwip.wikia.com/wiki/Netconn_send - this indicates lwip_sendto() should be using netbuf_new(). Typo?
Thanks,
Joel