Rx: Correct AFS_NT40_ENV rx_GetIFInfo max MTU assignments
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 15 Jan 2010 14:06:05 +0000 (09:06 -0500)
committerJeffrey Altman <jaltman|account-1000011@unknown>
Sat, 16 Jan 2010 02:05:34 +0000 (18:05 -0800)
On UNIX, the rx library values for rx_maxReceiveSize and
rx_MyMaxSendSize are sent by the cache manager directly.
In Windows, they are set by rx_GetIFInfo() which had two
errors.

(1) The comparison of rx_maxReceiveSize and maxsize were
    reversed which prevented rx_maxReceiveSize from ever
    being set to the interface MTU.

(2) rx_MyMaxSendSize was never assigned a value.

As a result, two problems occurred.

(1) The remote peer was never told about the local MTU.

(2) The local peer ignores the MTU.

From 1.3.60 to 1.5.33, OpenAFS for Windows installers
provided a registry default RxMaxMTU of 1260.  This caused
the cache manager to call rx_SetMaxMTU() which in turn set
both rx_maxReceiveSize and rx_MyMaxSendSize in effect
masking these errors.

Change-Id: Ib05927d7985052e233ff6f4bd170a939eb05c320
Reviewed-on: http://gerrit.openafs.org/1107
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/rx/rx_user.c

index 167b9c7..eb62ed7 100644 (file)
@@ -402,12 +402,14 @@ rx_GetIFInfo(void)
         maxsize =
             rxi_nRecvFrags * rxsize + (rxi_nRecvFrags - 1) * UDP_HDR_SIZE;
         maxsize = rxi_AdjustMaxMTU(rxsize, maxsize);
-        if (rx_maxReceiveSize < maxsize) {
+        if (rx_maxReceiveSize > maxsize) {
             rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxsize);
             rx_maxReceiveSize =
                 MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser);
         }
-
+        if (rx_MyMaxSendSize > maxsize) {
+            rx_MyMaxSendSize = MIN(RX_MAX_PACKET_SIZE, maxsize);
+        }
     }
     UNLOCK_IF;