From a36832e2d891caab8644a3b4641c7c94fab4105f Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 19 Sep 2019 12:18:08 -0500 Subject: [PATCH] rx: Avoid new server calls for big-seq DATA pkts We currently never open our receive window to more than 32 packets. If we received a DATA packet for an unrecognized call with a seq of 33 or more, the packet is almost certainly from a previously-running call that we were restarted during. As described in commit 7b204946 (rx: Avoid lastReceiveTime update for invalid ACKs) and commit "rx: Avoid new server calls for non-DATA packets", clients can get confused when we respond to calls in these situations, so drop the packets instead. Change-Id: I5b3a699bf245375e92ac97a24ad3638cbb3b8f3c Reviewed-on: https://gerrit.openafs.org/13876 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/rx/rx.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/rx/rx.c b/src/rx/rx.c index 06c9239..2296014 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -3310,6 +3310,20 @@ rxi_ReceiveServerCall(osi_socket socket, struct rx_packet *np, return NULL; } + if (np->header.seq > rx_maxReceiveWindow) { + /* + * This is a DATA packet for further along in the call than is + * possible for a new call. This is probably from an existing call + * that was in the middle of running when we were restarted; ignore + * it to avoid confusing clients. (See above comment about non-DATA + * packets.) + */ + MUTEX_EXIT(&conn->conn_call_lock); + if (rx_stats_active) + rx_atomic_inc(&rx_stats.spuriousPacketsRead); + return NULL; + } + if (rxi_AbortIfServerBusy(socket, conn, np)) { MUTEX_EXIT(&conn->conn_call_lock); return NULL; -- 1.9.4