From fd7cfb676bd51fcca059a1fb1be2b160eb01ed3c Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Thu, 28 Dec 2017 10:41:39 -0800 Subject: mpmd: Fix fake results returned by mpmd_find - For non-MPM Ethernet devices, mpmd_find would return a fake malformed discovery result which would accidentally trigger an mpmd_impl::make resulting in unexpected errors - Fixed mpmd_find to return an empty device_addrs_t object if no MPM devices are found --- host/lib/usrp/mpmd/mpmd_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/mpmd') diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index 02b3e66c3..8586aa3a9 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -645,7 +645,9 @@ device_addrs_t mpmd_find_with_addrs(const device_addrs_t& hints) "Device responded: " << reply_addrs[0].to_string()); found_devices.push_back(reply_addrs[0]); } - if (found_devices.size() == 1) { + if (found_devices.size() == 0) { + return device_addrs_t(); + } else if (found_devices.size() == 1) { return found_devices; } else { return device_addrs_t(1, combine_device_addrs(found_devices)); -- cgit v1.2.3