Skip to content

zeroconf: make continuous browse spec-conformant for device - #1

Merged
kennethhung863 merged 1 commit into
masterfrom
khung-spec-improvements
Aug 25, 2026
Merged

zeroconf: make continuous browse spec-conformant for device#1
kennethhung863 merged 1 commit into
masterfrom
khung-spec-improvements

Conversation

@kennethhung863

@kennethhung863 kennethhung863 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Currently, a zeroconf client only captures first entry and swallows any further updates. This prevents it from handling cases where its cache needs to be updated, making continuous browsing difficult. This PR has modifications to handle IP-address change, departures, and stale entries as per RFC 6792 to update the internal browse cache and track entries properly.

  • Surface entry change: re-deliver an entry when its address/port/TXT differs from what was last sent. This handles an IP-address change (RFC 6762 §8.4 / §10.2).
  • Goodbye handling: on a TTL==0 record, deliver a removal to the subscriber rather than silently dropping it (RFC 6762 §10.1).
  • TTL-expiry sweep: track per-entry expiry and sweep on a ticker, so a device that leaves without a goodbye is eventually removed instead of lingering forever (RFC 6762 §10).
  • Continuous-query backoff: set Multiplier=2 and MaxInterval=30m (was the default 1.5 / 60s) so periodic re-query grows by at least a factor of two up to a <=60m cap (RFC 6762 §5.2).

Comment thread client.go
sameStrs(a.Text, b.Text)
}

func sameIPs(a, b []net.IP) bool {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Maybe we can use the net package from golang to do this

Currently, client only captures first entry and swallows any further updates.
This commit has  modifications to handle IP-address change, departures, and
stale entries as per RFC 6792.

- Surface entry change: re-deliver an entry when its address/port/TXT
  differs from what was last sent. This handles an IP-address change
  (RFC 6762 §8.4 / §10.2).
- Goodbye handling: on a TTL==0 record, deliver a removal to the
  subscriber rather than silently dropping it (RFC 6762 §10.1).
- TTL-expiry sweep: track per-entry expiry and sweep on a ticker, so a
  device that leaves without a goodbye is eventually removed instead of
  lingering forever (RFC 6762 §10).
- Continuous-query backoff: set Multiplier=2 and MaxInterval=30m (was the
  default 1.5 / 60s) so periodic re-query grows by at least a factor of
  two up to a <=60m cap (RFC 6762 §5.2).
@kennethhung863
kennethhung863 force-pushed the khung-spec-improvements branch from cde1df4 to 6e95b13 Compare August 25, 2026 21:40
@kennethhung863
kennethhung863 merged commit e3f9560 into master Aug 25, 2026
0 of 8 checks passed
kennethhung863 added a commit that referenced this pull request Aug 25, 2026
zeroconf: make continuous browse spec-conformant for device
kennethhung863 added a commit that referenced this pull request Aug 25, 2026
zeroconf: make continuous browse spec-conformant for device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants