From: Derrick Brashear Date: Wed, 7 Jul 2010 14:43:48 +0000 (-0400) Subject: kernel InitPeerParams has bogus branching and dup code X-Git-Tag: openafs-devel-1_5_76~176 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=16efa8e8c368df67efd91314fc81e38682d367eb;p=packages%2Fo%2Fopenafs.git kernel InitPeerParams has bogus branching and dup code 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 Tested-by: Derrick Brashear --- diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index 17da066de..a88213f9e 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -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 */