RPC patch for 2.2.13-pre17

Trond Myklebust (trond.myklebust@fys.uio.no)
Sun, 17 Oct 1999 17:45:31 +0200 (CEST)


Hi Alan,

The following patch ensures that the RPC buffer is always
initialized to zero, so that zero-padding of strings and opaque
objects works as per RFC1014 ('If n is not a multiple of four, then
the n bytes are followed by enough (0 to 3) residual zero bytes, r, to
make the total byte count a multiple of four.').

Cheers,
Trond

--- linux-2.2.13-pre17/net/sunrpc/clnt.c.orig Tue Oct 6 18:39:44 1998
+++ linux-2.2.13-pre17/net/sunrpc/clnt.c Sun Oct 17 12:14:13 1999
@@ -467,6 +467,9 @@
return;
}

+ /* Zero buffer so we have automatic zero-padding of opaque & string */
+ memset(task->tk_buffer, 0, bufsiz);
+
/* Encode header and provided arguments */
encode = rpcproc_encode(clnt, task->tk_proc);
if (!(p = call_header(task))) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/