Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/discovery/sedp_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ impl From<RtpsReaderProxy> for ReaderProxy {
Self {
remote_reader_guid: rtps_reader_proxy.remote_reader_guid,
expects_inline_qos: rtps_reader_proxy.expects_inline_qos(),
unicast_locator_list: rtps_reader_proxy.unicast_locator_list,
unicast_locator_list: rtps_reader_proxy
.unicast_locator_list
.into_iter()
.chain(rtps_reader_proxy.loopback_unicast_locators)
.collect(),
multicast_locator_list: rtps_reader_proxy.multicast_locator_list,
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/rtps/rtps_reader_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ mod route_tests {

use super::*;
use crate::{
discovery::sedp_messages::ReaderProxy,
rtps::transmit::{DefaultRouteSelector, InterfaceObservations, InterfaceSelector},
structure::guid::GuidPrefix,
};
Expand Down Expand Up @@ -877,6 +878,16 @@ mod route_tests {
);
}

#[test]
fn discovery_record_keeps_bucket_loopback() {
// A remote reader bound only to loopback, e.g. CycloneDDS on `lo`.
let mut rp = proxy_with_prefix(GuidPrefix::new(&[9; 12]));
rp.loopback_unicast_locators = vec![udp([127, 0, 0, 1], 7413)];

let record = ReaderProxy::from(rp);
assert_eq!(record.unicast_locator_list, vec![udp([127, 0, 0, 1], 7413)]);
}

#[test]
fn same_host_route_selects_bucket_loopback() {
let prefix = GuidPrefix::new(&[8; 12]);
Expand Down