rx: protect against ACKs with serial as prevPacket
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 16 Jul 2012 21:29:54 +0000 (17:29 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 27 Jul 2012 19:59:04 +0000 (12:59 -0700)
patchset 4e71409fe1305cde4b9b341247ba658d8d24f4d0 introduced a
check in rxi_ReceiveAckPacket for out of order ack packets which
relied upon the value of the previousPacket field.  Unfortunately,
some versions of RX store the previous packet's serial number in
the field instead of previous packet's sequence number.  Modify
the check to only discard out of order ACKs if the previousPacket
sequence number is within the valid window.

Change-Id: I72885a8c1aaa69eb263335be1827545f2b4c3e09
Reviewed-on: http://gerrit.openafs.org/7785
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/rx/rx.c

index e344db5..6e0b367 100644 (file)
@@ -4252,9 +4252,14 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np,
     prev = ntohl(ap->previousPacket);
     serial = ntohl(ap->serial);
 
-    /* Ignore ack packets received out of order */
+    /*
+     * Ignore ack packets received out of order while protecting
+     * against peers that set the previousPacket field to a packet
+     * serial number instead of a sequence number.
+     */
     if (first < call->tfirst ||
-        (first == call->tfirst && prev < call->tprev)) {
+        (first == call->tfirst && prev < call->tprev && prev < call->tfirst
+        + call->twind)) {
        return np;
     }