zenoh icon indicating copy to clipboard operation
zenoh copied to clipboard

IFACES doesn't track interface changes

Open ao-swarm opened this issue 5 months ago • 5 comments

Describe the bug

IFACES is initialized once at program start and never updated. If the network configuration changes (interfaces come/go up/down), this static data is not representative of available interfaces.

Within my application's lifetime, the interfaces can change. VPN may turn on/off, different wifi point may be selected, etc. Zenoh does not pick up on those changes.

What I'm Looking For

In my Android app, I'm currently handling the recreation of Zenoh sessions after an interface change. Minimally, I'd like a way to trigger a refresh of that IFACES list so that any new session could connect as expected.

I'm not too familiar with Rust, but Copilot suggested this --

Consider once_cell for Finer Control If you want lazy static behavior but with the possibility to refresh, consider once_cell::sync::OnceCell and a function to refresh or re-populate the cache (with proper synchronization).

It seems to me if something were exposed in the core API and wrappers (Kotlin for me) to trigger that refresh, the cache could be updated.

To reproduce

On Android, in my case 2. Connect to Wifi 3. Start an app (Android, in my case) 4. Start a Zenoh session and receive some messages 5. Turn on VPN 6. Restart a Zenoh session with a config for tun0 interfaces 7. See that the session can't find/connect to tun0 interfaces (because it didn't exist on start)

System info

1.5.0

ao-swarm avatar Aug 08 '25 22:08 ao-swarm

Saw #2020, keeping an eye out for possible resolution

ao-swarm avatar Aug 11 '25 17:08 ao-swarm

Saw #2020, keeping an eye out for possible resolution

It would be quite useful if you could test that pull request and determine whether it enables your use case.

fuzzypixelz avatar Aug 18 '25 11:08 fuzzypixelz

If I get the chance, I will. No guarantees, though. I know effectively nothing about Rust projects, and I may not currently have the time to go through the process. We'll see!

ao-swarm avatar Aug 19 '25 17:08 ao-swarm

If I get the chance, I will. No guarantees, though. I know effectively nothing about Rust projects, and I may not currently have the time to go through the process. We'll see!

Are you using non-Rust bindings or zenohd?

fuzzypixelz avatar Aug 22 '25 09:08 fuzzypixelz

Running zenoh-kotlin in an Android app

ao-swarm avatar Aug 22 '25 16:08 ao-swarm