[gPXE-devel] [PATCH 1/2] [tcp] Prevent duplicate xfer_shutdown

Guo-Fu Tseng cooldavid at cooldavid.org
Sun Jul 18 22:21:12 EDT 2010


From: Guo-Fu Tseng <cooldavid at cooldavid.org>


Signed-off-by: Guo-Fu Tseng <cooldavid at cooldavid.org>
---
 src/net/tcp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/net/tcp.c b/src/net/tcp.c
index 230dce0..3e6543c 100644
--- a/src/net/tcp.c
+++ b/src/net/tcp.c
@@ -356,6 +356,9 @@ static void tcp_close ( struct tcp_connection *tcp ) {
  * Closes the data transfer interface.
  */
 static void tcp_xfer_shutdown ( struct tcp_connection *tcp, int rc ) {
+	if ( tcp->flags & TCP_XFER_CLOSED )
+		return;
+
 	/* Close data transfer interface */
 	xfer_nullify ( &tcp->xfer );
 	xfer_close ( &tcp->xfer, rc );
-- 
1.7.1



More information about the gPXE-devel mailing list