From f82d1c7d5aeae148305e867c1f79c6ea2f9e0a2a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 10 Feb 2018 10:47:24 -0500 Subject: [PATCH] rx: Do not count RXGEN_OPCODE towards abort threshold An RXGEN_OPCODE is returned for opcodes that are not implemented by the rx service. These opcodes might be deprecated opcodes that are no longer supported or more recently registered opcodes that have yet to be implemented. Clients should not be punished for issuing unsupported calls. The clients might be old and are issuing no longer supported calls or they might be newer and are issuing yet to be implemented calls as part of a feature test and fallback strategy. This change ignores RXGEN_OPCODE errors when deciding how to adjust the rx_call.abortCount. When an RXGEN_OPCODE abort is sent the rx_call.abortCount and rx_call.abortError are left unchanged which preserves the state for the next failing call. Note that this change intentionlly prevents the incrementing of the abortCount for client connections as they never send delay aborts. Change-Id: I87787e7ad0a85d52a01711bb75e2be1af9a868b8 Reviewed-on: https://gerrit.openafs.org/12906 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/rx/rx.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 84f6c74..c7742fa 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -5086,7 +5086,14 @@ rxi_SendCallAbort(struct rx_call *call, struct rx_packet *packet, if (rx_IsClientConn(call->conn)) force = 1; - if (call->abortCode != call->error) { + /* + * An opcode that has been deprecated or has yet to be implemented is not + * a misbehavior of the client. Do not punish the client by introducing + * delays. + */ + if (call->error == RXGEN_OPCODE) { + force = 1; + } else if (call->abortCode != call->error) { call->abortCode = call->error; call->abortCount = 0; } @@ -5095,7 +5102,8 @@ rxi_SendCallAbort(struct rx_call *call, struct rx_packet *packet, || call->abortCount < rxi_callAbortThreshhold) { rxi_CancelDelayedAbortEvent(call); error = htonl(call->error); - call->abortCount++; + if (!force) + call->abortCount++; packet = rxi_SendSpecial(call, call->conn, packet, RX_PACKET_TYPE_ABORT, (char *)&error, sizeof(error), istack); -- 1.9.4