From 86f9a5d44a7e1e5f41826eda9ba8d92c631f162a Mon Sep 17 00:00:00 2001 From: ps Date: Wed, 5 Jan 2005 23:21:13 +0000 Subject: If the NFS/TCP stream is out of sync between the client and server, and if the client (erroneously) reads the RPC length as 0 bytes, the client can loop around in the socket callback. Explicitly check for the length being 0 case and teardown/re-connect. Submitted by: Mohan Srinivasan --- sys/nfsclient/nfs_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/nfsclient/nfs_socket.c') diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 8a25ce1..2f44b3f 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -836,7 +836,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, void *arg, int waitflag) * This is SERIOUS! We are out of sync with the sender * and forcing a disconnect/reconnect is all I can do. */ - if (len > NFS_MAXPACKET) { + if (len > NFS_MAXPACKET || len == 0) { log(LOG_ERR, "%s (%d) from nfs server %s\n", "impossible packet length", len, -- cgit v1.1