Skip to content

AvahiBrowserImpl can return stale IP when resolveHost is called #5405

Description

@mmseines

Describe the bug
If a host changes IP without creating a new serviceFound/serviceRemoved event.
resolveHost will indefinitly return the wrong IP for said host.

To Reproduce
Running on Linux with AvahiBrowserImpl as the browser selected.

External device with hostname changes IP (for any reason) but keeps its hostname/service.
App implementation calls DNSSDBrowser.resolve() on serviceFound callback and calls DNSSDBrowser.resolveHost() on serviceResolved callback.

Expected behavior
According to documentation i expected a query to avahi API to retrieve the most recent IP.
Instead a synchronous lookup of the _addressMap is performed.

Alternatively cached IP time out eventually, causing the state to self correct after a while.

Logs

Log from app running Poco::DNSSD

Resolving host HOSTNAME.local on interface 4
Host resolved: (HOSTNAME.local, 192.168.100.46, 4)

However avahi appears to have the correct IP

ping HOSTNAME.local
PING HOSTNAME.local (192.168.100.51): 56 data bytes
64 bytes from 192.168.100.51: seq=0 ttl=128 time=134.214 ms
64 bytes from 192.168.100.51: seq=1 ttl=128 time=6.130 ms
64 bytes from 192.168.100.51: seq=2 ttl=128 time=6.065 ms

restarting the app or destroying and re-initializing poco resolves the error.

Screenshots
N/A

Please add relevant environment information:

  • Linux 5.15.98
  • POCO Version 1.14.0
  • systemd: 250.5
  • avahi: 0.8

Additional context
Embedded device communicating with another embedded device.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions