[minip][tcp] fix race introduced by dropping the socket's mutex across tcp_send

-There was a path where the tcp sender is queuing multiple packets in a row but
during the send it received a packet that moved the tx buffer out from underneath it.
This commit is contained in:
Travis Geiselbrecht
2014-08-07 15:06:11 -07:00
parent 312e5e146a
commit 74771f942f

View File

@@ -464,10 +464,8 @@ static status_t tcp_socket_send(tcp_socket_t *s, const void *data, size_t len, t
}
#endif
mutex_release(&s->lock);
status_t err = tcp_send(s->remote_ip, s->remote_port, s->local_ip, s->local_port, data, len, flags,
options, options_length, (flags & PKT_ACK) ? s->rx_win_low : 0, sequence, win_size);
mutex_acquire(&s->lock);
return err;
}