diff options
author | mav <mav@FreeBSD.org> | 2017-03-01 04:24:30 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2017-03-01 04:24:30 +0000 |
commit | aca8947d4bd32c04b233e0852fb66af7c9c65c11 (patch) | |
tree | 6abe11c65b997ea45fe8ec115ca340135fc57f16 | |
parent | ab3ab7c73bbcf54890a5e036d2d843414fb25b24 (diff) | |
download | FreeBSD-src-aca8947d4bd32c04b233e0852fb66af7c9c65c11.zip FreeBSD-src-aca8947d4bd32c04b233e0852fb66af7c9c65c11.tar.gz |
MFC r313779: Fix handling of negative sbspace() return values.
I found that at least with Chelsio NICs TOE sockets quite often report
negative sbspace() values. Using unsigned variable to store it resulted
in attempts to aggregate too much data in one sosend() call, that caused
errors and following connection termination.
-rw-r--r-- | sys/dev/iscsi/icl_soft.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 2f72152..68c547c 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -892,7 +892,7 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) { struct icl_pdu *request, *request2; struct socket *so; - size_t available, size, size2; + long available, size, size2; int coalesced, error; ICL_CONN_LOCK_ASSERT_NOT(ic); @@ -931,7 +931,7 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) if (available < size) { #if 1 ICL_DEBUG("no space to send; " - "have %zd, need %zd", + "have %ld, need %ld", available, size); #endif so->so_snd.sb_lowat = size; @@ -978,7 +978,7 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) } #if 0 if (coalesced > 1) { - ICL_DEBUG("coalesced %d PDUs into %zd bytes", + ICL_DEBUG("coalesced %d PDUs into %ld bytes", coalesced, size); } #endif |