Skip to content

fix: rejoin mDNS multicast after suspend/resume - #8

Merged
keskad merged 7 commits into
mainfrom
fix/mdns-suspend-resume-rejoin
Aug 20, 2026
Merged

fix: rejoin mDNS multicast after suspend/resume#8
keskad merged 7 commits into
mainfrom
fix/mdns-suspend-resume-rejoin

Conversation

@keskad

@keskad keskad commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Force IGMP leave+join on 224.0.0.251 / ff02::fb when netlink signals a change but the address set is unchanged (link flap / resume with the same DHCP lease).
  • Detect suspend/resume via a CLOCK_BOOTTIME − CLOCK_MONOTONIC skew jump; on resume recreate legacy UDP sockets and restart mdns-sd so multicast membership is rebuilt from scratch.
  • Treat interfaces as usable only when IFF_RUNNING or operstate=up, not administratively-up IFF_UP alone (stale Wi‑Fi after wake).

Test plan

  • cargo test (unit + integration, including dummy iface down/up with same address)
  • cargo clippy --all-targets -- -D warnings
  • Suspend laptop hosting microdns, wake, confirm bigfred.local resolves without restarting the daemon
  • Check logs for suspend/resume detected and mDNS multicast joined after wake

Made with Cursor

keskad and others added 7 commits August 19, 2026 10:54
Force IGMP leave+join and mdns-sd re-announce when netlink fires with
unchanged IPs, detect suspend via CLOCK_BOOTTIME skew, and treat
interfaces as usable only when IFF_RUNNING or operstate=up.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop microinit list and /proc port scans. Poll dcc_bus_list and use the
catalogue ports in TXT, including layoutName.

Co-authored-by: Cursor <cursoragent@cursor.com>
Guessed ports and procMs did nothing after socket polling. The
connected interval is pollMs; microinitMs still parses as an alias.

Co-authored-by: Cursor <cursoragent@cursor.com>
Poll the BigFred control socket every 45s once connected, matching
the backoff used when the socket is down.

Co-authored-by: Cursor <cursoragent@cursor.com>
Expose live DesiredAds over $DATA_DIR/run/microdns.sock so the CLI can query
what the daemon advertises (static + dcc-bus DNS-SD) without reading config.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use libc IFF_* flags, log clock_gettime failures once, skip a second epoch bump while recreate is pending, and poll suspend skew at 1s instead of every netlink slice.

Co-authored-by: Cursor <cursoragent@cursor.com>
Unblocks CI clippy -D warnings for the dcc-bus TXT helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
@keskad
keskad merged commit 76821b8 into main Aug 20, 2026
4 checks passed
@keskad
keskad deleted the fix/mdns-suspend-resume-rejoin branch August 20, 2026 08:07
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.

1 participant