diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-04-10 14:11:07 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-04-10 14:11:07 +0000 |
commit | df189505332f627b17f603626e24cd7dcfeba94c (patch) | |
tree | 89efb7b1bf5b41e4796cb214dfd3ca4a099de140 /lib/libc | |
parent | d2181eff24a7ff9d560892b9c657b5637acaecd0 (diff) | |
download | FreeBSD-src-df189505332f627b17f603626e24cd7dcfeba94c.zip FreeBSD-src-df189505332f627b17f603626e24cd7dcfeba94c.tar.gz |
Fix a bug in the userland rpc library, where it would use a
negative return value from write to update its position in
a buffer. The patch, courtesy of Andrey Simonenko, also simplifies
a conditional by removing the "i != cnt" clause, since it is
always true at this point in the code. The bug caused problems
for mountd, when it generated a large reply to an exports RPC
request.
Submitted by: simon at comsys.ntu-kpi.kiev.ua
MFC after: 2 weeks
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/svc_vc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c index 3fd8b7e..aded6b1 100644 --- a/lib/libc/rpc/svc_vc.c +++ b/lib/libc/rpc/svc_vc.c @@ -546,7 +546,7 @@ write_vc(xprtp, buf, len) cd->strm_stat = XPRT_DIED; return (-1); } - if (cd->nonblock && i != cnt) { + if (cd->nonblock) { /* * For non-blocking connections, do not * take more than 2 seconds writing the @@ -560,6 +560,7 @@ write_vc(xprtp, buf, len) return (-1); } } + i = 0; } } |