Skip to content

feat: v0.6.0 mDNS discovery — Discoverer/Announcer interfaces - #6

Merged
SoundMatt merged 1 commit into
mainfrom
feat/v0.6.0-mdns-discovery
Jul 27, 2026
Merged

feat: v0.6.0 mDNS discovery — Discoverer/Announcer interfaces#6
SoundMatt merged 1 commit into
mainfrom
feat/v0.6.0-mdns-discovery

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Milestone 6 of ROADMAP.md. Ports cpp-RCP's mdns.hpp:

  • include/rcp/mdns.h + src/mdns.c — abstract rcp_mdns_discoverer_t /
    rcp_mdns_announcer_t vtable interfaces plus a concrete
    rcp_mdns_static_discoverer_t (deep-copies its zone list so callers don't
    need to keep the input alive). No concrete Announcer ships here — matches
    cpp-RCP; a real mDNS responder needs platform APIs out of scope here.
  • tests/test_mdns.c ports cpp-RCP's test_mdns.cpp (8 requirements),
    including its own local TestAnnouncer test double (same as cpp-RCP does).

Fixed before opening this PR

A real cfusa cyber finding (hard CI gate, unlike the known/ticketed L004
lint bug): calloc()'s sizeof(*ptr) argument used the same
arrow-dereferenced pointer being assigned on the same line, tripping
CY004's malloc/calloc-then-dereference heuristic — same root cause as two
earlier fixes in mock.c, missed here on first pass. Fixed, then
proactively grepped the rest of src/*.c for the same pattern; nothing
else matched.

Test plan

  • Build + ctest — 7/7 passing (was 6/6)
  • Same build/tests under -fsanitize=address,undefined — clean
  • cfusa trace --req-coverage 100 — metric 2 still 100%, metric 1 now 52% (104/198), non-blocking per v0.2.0
  • cfusa analyze / cfusa cyber / cfusa qualify / cfusa vuln — all clean (0 errors)
  • cfusa check — 3 errors, all the known/ticketed L004 false-positive, non-blocking
  • CI green on this PR

Ports cpp-RCP's mdns.hpp: abstract rcp_mdns_discoverer_t/rcp_mdns_announcer_t
vtable interfaces plus a concrete rcp_mdns_static_discoverer_t (deep-copies
its zone list, including host/instance_name strings, so callers don't need
to keep their input alive). No concrete Announcer ships here, matching
cpp-RCP — a real mDNS responder (Avahi/dns_sd) needs platform APIs outside
this library's scope.

tests/test_mdns.c ports cpp-RCP's test_mdns.cpp (8 requirements), including
its own local TestAnnouncer test double (cpp-RCP defines this in the test
file too, not in mdns.hpp itself).

Fixed one real cyber-gate finding before opening this PR (a hard CI
blocker, unlike the known/ticketed L004 lint bug): a calloc() call whose
sizeof(*ptr) argument used the same arrow-dereferenced pointer being
assigned, tripping CFUSA-CY004's malloc/calloc-then-dereference heuristic
— same root cause as two earlier fixes in mock.c, just missed here on
first pass. Proactively grepped the rest of src/*.c for the same pattern
afterward; nothing else matched.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit a33de8c into main Jul 27, 2026
18 checks passed
@SoundMatt
SoundMatt deleted the feat/v0.6.0-mdns-discovery branch July 27, 2026 15:18
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