From ece28c9ef8ab7daf5422094123efe9e5c0b939fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 12 Oct 2006 09:41:54 +0000 Subject: [PATCH] Fixed a possible crashing bug. Note, Andrew, if you want to store a route, it's *not* okay to keep it around all times. The net_route_info is thought for that as it allows the stack to switch to different routes (ie. if the interface has been changed, ...). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19049 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/network/protocols/tcp/TCPConnection.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/add-ons/kernel/network/protocols/tcp/TCPConnection.h b/src/add-ons/kernel/network/protocols/tcp/TCPConnection.h index 14ebd4b908..b9cc67b39a 100644 --- a/src/add-ons/kernel/network/protocols/tcp/TCPConnection.h +++ b/src/add-ons/kernel/network/protocols/tcp/TCPConnection.h @@ -615,6 +615,9 @@ TCPConnection::Send(uint16 flags, bool empty) { TRACE(("TCP:%p.Send(%X,%s)\n", this, flags, empty ? "1" : "0")); + if (fRoute == NULL) + return B_ERROR; + net_buffer *buffer; uint32 effectiveWindow = min_c(tcp_get_mtu(this, (sockaddr *)&socket->address), fNextByteToWrite - fNextByteToSend); if (empty || effectiveWindow == 0 || fSendBuffer == NULL || fSendBuffer->size == 0) {