summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2005-03-14 22:15:14 +0000
committerRobert Watson <rwatson@FreeBSD.org>2005-03-14 22:15:14 +0000
commitd2bc35ab296927eafb455e5068bf625d230b1281 (patch)
treef5c38fed8e67a8c337a70c51533965840c459cad
parentf5ba17d43ba9b983c9ce9b2b9cc57b257b711e48 (diff)
Notes
-rw-r--r--sys/netinet/tcp_usrreq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index e5ddf5885a66..ee3970dcc5a0 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -702,7 +702,9 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
tp->t_flags &= ~TF_MORETOCOME;
}
} else {
+ SOCKBUF_LOCK(&so->so_snd);
if (sbspace(&so->so_snd) < -512) {
+ SOCKBUF_UNLOCK(&so->so_snd);
m_freem(m);
error = ENOBUFS;
goto out;
@@ -715,7 +717,8 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
* of data past the urgent section.
* Otherwise, snd_up should be one lower.
*/
- sbappendstream(&so->so_snd, m);
+ sbappendstream_locked(&so->so_snd, m);
+ SOCKBUF_UNLOCK(&so->so_snd);
if (nam && tp->t_state < TCPS_SYN_SENT) {
/*
* Do implied connect if not yet connected,