diff --git a/zenoh/src/net/routing/pubsub.rs b/zenoh/src/net/routing/pubsub.rs index 3deba60260..0cad9cac80 100644 --- a/zenoh/src/net/routing/pubsub.rs +++ b/zenoh/src/net/routing/pubsub.rs @@ -1421,7 +1421,10 @@ pub(super) fn compute_data_routes_(tables: &Tables, res: &Arc) -> Data compute_data_route(tables, &mut expr, Some(idx.index()), WhatAmI::Router); } - routes.peer_data_route = Some(compute_data_route(tables, &mut expr, None, WhatAmI::Peer)); + if !tables.full_net(WhatAmI::Peer) { + routes.peer_data_route = + Some(compute_data_route(tables, &mut expr, None, WhatAmI::Peer)); + } } if (tables.whatami == WhatAmI::Router || tables.whatami == WhatAmI::Peer) && tables.full_net(WhatAmI::Peer) @@ -1479,8 +1482,10 @@ pub(crate) fn compute_data_routes(tables: &mut Tables, res: &mut Arc) compute_data_route(tables, &mut expr, Some(idx.index()), WhatAmI::Router); } - res_mut.context_mut().peer_data_route = - Some(compute_data_route(tables, &mut expr, None, WhatAmI::Peer)); + if !tables.full_net(WhatAmI::Peer) { + res_mut.context_mut().peer_data_route = + Some(compute_data_route(tables, &mut expr, None, WhatAmI::Peer)); + } } if (tables.whatami == WhatAmI::Router || tables.whatami == WhatAmI::Peer) && tables.full_net(WhatAmI::Peer) diff --git a/zenoh/src/net/routing/queries.rs b/zenoh/src/net/routing/queries.rs index c55cfc046c..a9d5ffd698 100644 --- a/zenoh/src/net/routing/queries.rs +++ b/zenoh/src/net/routing/queries.rs @@ -1529,7 +1529,10 @@ pub(super) fn compute_query_routes_(tables: &Tables, res: &Arc) -> Que compute_query_route(tables, &mut expr, Some(idx.index()), WhatAmI::Router); } - routes.peer_query_route = Some(compute_query_route(tables, &mut expr, None, WhatAmI::Peer)); + if !tables.full_net(WhatAmI::Peer) { + routes.peer_query_route = + Some(compute_query_route(tables, &mut expr, None, WhatAmI::Peer)); + } } if (tables.whatami == WhatAmI::Router || tables.whatami == WhatAmI::Peer) && tables.full_net(WhatAmI::Peer) @@ -1595,8 +1598,10 @@ pub(crate) fn compute_query_routes(tables: &mut Tables, res: &mut Arc) compute_query_route(tables, &mut expr, Some(idx.index()), WhatAmI::Router); } - res_mut.context_mut().peer_query_route = - Some(compute_query_route(tables, &mut expr, None, WhatAmI::Peer)); + if !tables.full_net(WhatAmI::Peer) { + res_mut.context_mut().peer_query_route = + Some(compute_query_route(tables, &mut expr, None, WhatAmI::Peer)); + } } if (tables.whatami == WhatAmI::Router || tables.whatami == WhatAmI::Peer) && tables.full_net(WhatAmI::Peer)