fixed a potential problem in TCP's accept() with the init'ing of new connections' MSS
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20527 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
02a6d07927
commit
868583b54a
@ -236,8 +236,7 @@ TCPEndpoint::Connect(const struct sockaddr *address)
|
||||
return status;
|
||||
}
|
||||
|
||||
fReceiveMaxSegmentSize = next->module->get_mtu(next, (sockaddr *)address)
|
||||
- sizeof(tcp_header);
|
||||
fReceiveMaxSegmentSize = _GetMSS(address);
|
||||
|
||||
// Compute the window shift we advertise to our peer - if it doesn't support
|
||||
// this option, this will be reset to 0 (when its SYN is received)
|
||||
@ -597,7 +596,7 @@ TCPEndpoint::ListenReceive(tcp_segment_header &segment, net_buffer *buffer)
|
||||
endpoint->fReceiveQueue.SetInitialSequence(segment.sequence + 1);
|
||||
endpoint->fState = SYNCHRONIZE_RECEIVED;
|
||||
endpoint->fAcceptSemaphore = fAcceptSemaphore;
|
||||
endpoint->fReceiveMaxSegmentSize = endpoint->fRoute->mtu - 40;
|
||||
endpoint->fReceiveMaxSegmentSize = _GetMSS((sockaddr *)&newSocket->peer);
|
||||
// 40 bytes for IP and TCP header without any options
|
||||
// TODO: make this depending on the RTF_LOCAL flag?
|
||||
endpoint->fReceiveNext = segment.sequence + 1;
|
||||
@ -1208,6 +1207,13 @@ TCPEndpoint::_SendQueued(bool force)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
TCPEndpoint::_GetMSS(const sockaddr *address) const
|
||||
{
|
||||
return next->module->get_mtu(next, (sockaddr *)address) - sizeof(tcp_header);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - timer
|
||||
|
||||
|
||||
|
@ -65,6 +65,7 @@ class TCPEndpoint : public net_protocol {
|
||||
bool _ShouldSendSegment(tcp_segment_header &segment, uint32 length,
|
||||
bool outstandingAcknowledge);
|
||||
status_t _SendQueued(bool force = false);
|
||||
int _GetMSS(const struct sockaddr *) const;
|
||||
|
||||
static void _TimeWaitTimer(net_timer *timer, void *data);
|
||||
static void _RetransmitTimer(net_timer *timer, void *data);
|
||||
|
Loading…
Reference in New Issue
Block a user