afsd-allow-maxmtu-override-20090530
[openafs.git] / src / rx / rx_kcommon.c
index 7eb0cd5..9d55474 100644 (file)
@@ -418,7 +418,7 @@ rxi_InitPeerParams(struct rx_peer *pp)
     if (i == -1) {
        pp->timeout.sec = 3;
        /* pp->timeout.usec = 0; */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     } else {
        pp->timeout.sec = 2;
        /* pp->timeout.usec = 0; */
@@ -434,7 +434,7 @@ rxi_InitPeerParams(struct rx_peer *pp)
                pp->ifMTU = rxmtu;
        }
     } else {                   /* couldn't find the interface, so assume the worst */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     }
 #else /* AFS_USERSPACE_IP_ADDR */
     AFS_IFNET_T ifn;
@@ -466,7 +466,7 @@ rxi_InitPeerParams(struct rx_peer *pp)
     } else {                   /* couldn't find the interface, so assume the worst */
        pp->timeout.sec = 3;
        /* pp->timeout.usec = 0; */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     }
 #endif /* else AFS_USERSPACE_IP_ADDR */
 #else /* AFS_SUN5_ENV */
@@ -475,7 +475,7 @@ rxi_InitPeerParams(struct rx_peer *pp)
     if (mtu <= 0) {
        pp->timeout.sec = 3;
        /* pp->timeout.usec = 0; */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     } else {
        pp->timeout.sec = 2;
        /* pp->timeout.usec = 0; */
@@ -491,7 +491,7 @@ rxi_InitPeerParams(struct rx_peer *pp)
                pp->ifMTU = rxmtu;
        }
     } else {                   /* couldn't find the interface, so assume the worst */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE,rx_MyMaxSendSize);
     }
 #endif /* AFS_SUN5_ENV */
 #else /* ADAPT_MTU */