diff options
author | Josh Blum <josh@joshknows.com> | 2011-03-13 18:08:17 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-03-13 18:08:17 -0700 |
commit | e5b625a59b047481e648a3d9f8871e226d6ab7aa (patch) | |
tree | 001640997bfc0b652d475e0afca79e13523c5521 /host | |
parent | 663af458b155a434fa45de8bc3f8de63cfaffcdb (diff) | |
download | uhd-e5b625a59b047481e648a3d9f8871e226d6ab7aa.tar.gz uhd-e5b625a59b047481e648a3d9f8871e226d6ab7aa.tar.bz2 uhd-e5b625a59b047481e648a3d9f8871e226d6ab7aa.zip |
usrp2: clip the mtu discovery if its within default MTU + a few
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index cb4d793ab..505df662a 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -208,6 +208,12 @@ static mtu_result_t determine_mtu(const std::string &addr){ else max_send_mtu = mtu.send_mtu - 4; } + //don't trust the discovery if it lands slightly above default MTU + if (mtu.recv_mtu > udp_simple::mtu and mtu.recv_mtu <= udp_simple::mtu + 16) + mtu.recv_mtu = udp_simple::mtu; + if (mtu.send_mtu > udp_simple::mtu and mtu.send_mtu <= udp_simple::mtu + 16) + mtu.send_mtu = udp_simple::mtu; + return mtu; } |