Clarified packet ownership transfer between a few functions.
authorMichael Brown <mcb30@etherboot.org>
Wed, 9 Aug 2006 01:24:32 +0000 (01:24 +0000)
committerMichael Brown <mcb30@etherboot.org>
Wed, 9 Aug 2006 01:24:32 +0000 (01:24 +0000)
commita3d508b648906fb742e5205bcd4b97fbf88ea653
treef5783a075a4d73d014949412a2323637bace4a09
parentfd07f56f0d9af8f754ee67cadf35cf498ad759e0
Clarified packet ownership transfer between a few functions.

Added a large number of missing calls to free_pkb().  In the case of UDP,
no received packets were ever freed, which lead to memory exhaustion
remarkably quickly once pxelinux started up.

In general, any function with _rx() in its name which accepts a pk_buff
*must* either call free_pkb() or pass the pkb to another _rx() function
(e.g. the next layer up the stack).  Since the UDP (and TCP) layers don't
pass packet buffers up to the higher-layer protocols (the
"applications"), they must free the packet buffer after calling the
application's newdata() method.
src/include/gpxe/netdevice.h
src/net/ethernet.c
src/net/ipv4.c
src/net/netdevice.c
src/net/tcpip.c
src/net/udp.c