]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
kernel InitPeerParams has bogus branching and dup code
authorDerrick Brashear <shadow@dementia.org>
Wed, 7 Jul 2010 14:43:48 +0000 (10:43 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 7 Jul 2010 14:51:23 +0000 (07:51 -0700)
several of the mtu configuration cases for the kernel version
of InitPeerParams were bogus. clean up the function.
(a forthcoming change reworks this anyway, but..)

Change-Id: Ia4449d5cecc80cddae7d0f611186f48614b908ee
Reviewed-on: http://gerrit.openafs.org/2343
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx_kcommon.c

index 17da066dec528536f64e029a82fd5d87e6f7213c..a88213f9e973492c2ace0cbb2ee77f3b8a37eff7 100644 (file)
@@ -385,8 +385,6 @@ rxi_InitPeerParams(struct rx_peer *pp)
        pp->timeout.sec = 2;
        /* pp->timeout.usec = 0; */
        pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize);
-    }
-    if (i != -1) {
        mtu = ntohl(afs_cb_interface.mtu[i]);
        /* Diminish the packet size to one based on the MTU given by
         * the interface. */
@@ -395,8 +393,6 @@ rxi_InitPeerParams(struct rx_peer *pp)
            if (rxmtu < pp->ifMTU)
                pp->ifMTU = rxmtu;
        }
-    } else {                   /* couldn't find the interface, so assume the worst */
-       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     }
 #  else /* AFS_USERSPACE_IP_ADDR */
     rx_ifnet_t ifn;
@@ -444,9 +440,7 @@ rxi_InitPeerParams(struct rx_peer *pp)
        pp->timeout.sec = 2;
        /* pp->timeout.usec = 0; */
        pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize);
-    }
 
-    if (mtu > 0) {
        /* Diminish the packet size to one based on the MTU given by
         * the interface. */
        if (mtu > (RX_IPUDP_SIZE + RX_HEADER_SIZE)) {
@@ -454,8 +448,6 @@ rxi_InitPeerParams(struct rx_peer *pp)
            if (rxmtu < pp->ifMTU)
                pp->ifMTU = rxmtu;
        }
-    } else {                   /* couldn't find the interface, so assume the worst */
-       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE,rx_MyMaxSendSize);
     }
 # endif /* AFS_SUN5_ENV */
 #else /* ADAPT_MTU */