diff --git a/zenoh/src/net/routing/hat/client/token.rs b/zenoh/src/net/routing/hat/client/token.rs index b567e747b3..ec8b228c51 100644 --- a/zenoh/src/net/routing/hat/client/token.rs +++ b/zenoh/src/net/routing/hat/client/token.rs @@ -135,6 +135,14 @@ fn declare_simple_token( ); return; } + } else if !face.local_interests.contains_key(&interest_id) { + tracing::debug!( + "Received DeclareToken for {} from {} with unknown interest_id {}. Ignore.", + res.expr(), + face, + interest_id, + ); + return; } } register_simple_token(tables, face, id, res); diff --git a/zenoh/src/net/routing/hat/p2p_peer/token.rs b/zenoh/src/net/routing/hat/p2p_peer/token.rs index 9d583d6ba7..d9f798c18c 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/token.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/token.rs @@ -206,6 +206,14 @@ fn declare_simple_token( ); return; } + } else if !face.local_interests.contains_key(&interest_id) { + println!( + "Received DeclareToken for {} from {} with unknown interest_id {}. Ignore.", + res.expr(), + face, + interest_id, + ); + return; } } register_simple_token(tables, face, id, res);