remove redundant MTU boundary checks
This commit is contained in:
parent
9b9ed6ad60
commit
8d40cf6227
@ -56,7 +56,6 @@ namespace libtorrent {
|
|||||||
constexpr int TORRENT_ETHERNET_MTU = 1500;
|
constexpr int TORRENT_ETHERNET_MTU = 1500;
|
||||||
constexpr int TORRENT_TEREDO_MTU = 1280;
|
constexpr int TORRENT_TEREDO_MTU = 1280;
|
||||||
constexpr int TORRENT_INET_MIN_MTU = 576;
|
constexpr int TORRENT_INET_MIN_MTU = 576;
|
||||||
constexpr int TORRENT_INET_MAX_MTU = 0xffff;
|
|
||||||
|
|
||||||
// used for out-of-order incoming packets
|
// used for out-of-order incoming packets
|
||||||
// as well as sent packets that are waiting to be ACKed
|
// as well as sent packets that are waiting to be ACKed
|
||||||
|
@ -105,10 +105,6 @@ namespace libtorrent {
|
|||||||
}
|
}
|
||||||
#endif
|
#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;
|
int const link_mtu = mtu;
|
||||||
|
|
||||||
mtu -= TORRENT_UDP_HEADER;
|
mtu -= TORRENT_UDP_HEADER;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user