aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2017-12-28 10:41:39 -0800
committerAshish Chaudhari <ashish@ettus.com>2017-12-28 10:41:39 -0800
commitfd7cfb676bd51fcca059a1fb1be2b160eb01ed3c (patch)
treebe8fae4780b5d3fe56bb28467c5dc90481474721 /host/lib/usrp/mpmd
parent7a588a564529a29389371b9990477c4dab8a1771 (diff)
downloaduhd-fd7cfb676bd51fcca059a1fb1be2b160eb01ed3c.tar.gz
uhd-fd7cfb676bd51fcca059a1fb1be2b160eb01ed3c.tar.bz2
uhd-fd7cfb676bd51fcca059a1fb1be2b160eb01ed3c.zip
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
Diffstat (limited to 'host/lib/usrp/mpmd')
-rw-r--r--host/lib/usrp/mpmd/mpmd_impl.cpp4
1 files changed, 3 insertions, 1 deletions
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));