remove redundant MTU boundary checks

This commit is contained in:
arvidn 2018-11-12 00:33:44 +01:00 committed by Arvid Norberg
parent 9b9ed6ad60
commit 8d40cf6227
2 changed files with 0 additions and 5 deletions

View File

@ -56,7 +56,6 @@ namespace libtorrent {
constexpr int TORRENT_ETHERNET_MTU = 1500;
constexpr int TORRENT_TEREDO_MTU = 1280;
constexpr int TORRENT_INET_MIN_MTU = 576;
constexpr int TORRENT_INET_MAX_MTU = 0xffff;
// used for out-of-order incoming packets
// as well as sent packets that are waiting to be ACKed

View File

@ -105,10 +105,6 @@ namespace libtorrent {
}
#endif
// clamp the MTU within reasonable bounds
if (mtu < TORRENT_INET_MIN_MTU) mtu = TORRENT_INET_MIN_MTU;
else if (mtu > TORRENT_INET_MAX_MTU) mtu = TORRENT_INET_MAX_MTU;
int const link_mtu = mtu;
mtu -= TORRENT_UDP_HEADER;