diff options
author | Michael Brown <mcb30@etherboot.org> | 2006-08-09 01:24:32 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2006-08-09 01:24:32 +0000 |
commit | a3d508b648906fb742e5205bcd4b97fbf88ea653 (patch) | |
tree | f5783a075a4d73d014949412a2323637bace4a09 /src/net/tcpip.c | |
parent | fd07f56f0d9af8f754ee67cadf35cf498ad759e0 (diff) | |
download | ipxe-a3d508b648906fb742e5205bcd4b97fbf88ea653.tar.gz |
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.
Diffstat (limited to 'src/net/tcpip.c')
-rw-r--r-- | src/net/tcpip.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/net/tcpip.c b/src/net/tcpip.c index 4a44a556..33c9872c 100644 --- a/src/net/tcpip.c +++ b/src/net/tcpip.c @@ -54,6 +54,7 @@ int tcpip_rx ( struct pk_buff *pkb, uint8_t tcpip_proto, } DBG ( "Unrecognised TCP/IP protocol %d\n", tcpip_proto ); + free_pkb ( pkb ); return -EPROTONOSUPPORT; } @@ -78,6 +79,7 @@ int tcpip_tx ( struct pk_buff *pkb, struct tcpip_protocol *tcpip_protocol, } DBG ( "Unrecognised TCP/IP address family %d\n", st_dest->st_family ); + free_pkb ( pkb ); return -EAFNOSUPPORT; } |