Date: Sun, 10 Apr 2011 14:11:08 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r220519 - head/lib/libc/rpc Message-ID: <201104101411.p3AEB8jV050463@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sun Apr 10 14:11:07 2011 New Revision: 220519 URL: http://svn.freebsd.org/changeset/base/220519 Log: 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 Modified: head/lib/libc/rpc/svc_vc.c Modified: head/lib/libc/rpc/svc_vc.c ============================================================================== --- head/lib/libc/rpc/svc_vc.c Sun Apr 10 13:45:46 2011 (r220518) +++ head/lib/libc/rpc/svc_vc.c Sun Apr 10 14:11:07 2011 (r220519) @@ -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; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104101411.p3AEB8jV050463>