From e5b625a59b047481e648a3d9f8871e226d6ab7aa Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 13 Mar 2011 18:08:17 -0700 Subject: usrp2: clip the mtu discovery if its within default MTU + a few --- host/lib/usrp/usrp2/usrp2_impl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/lib/usrp') 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; } -- cgit v1.2.3