feat(protocol): discover known-host OCF responder ports - #47
Conversation
b66fea7 to
512df7f
Compare
|
Tested this branch against two Samsung OCF devices with dynamic response ports: a soundbar ( 20/20 hits on each, ports matching an independent sweep run at the same time. One note: every call takes the full |
|
Merging this one. TTL 1 so it cannot leave the subnet, multicast loopback off, caps on datagram size, datagrams per round and distinct ports, one monotonic deadline across all rounds, and every socket closed on every return path. @vmonkey's two-device result is what moved it from plausible to tested. Separately: #36, #48, #49, #50 and #54 all collide with each other in |
Summary
Why
The moving plaintext responder port is one of the remaining package-level gaps described in mbillow/localthings#388. Some devices receive discovery on UDP 5683 but reply from a different source port, and that source port can change after a power cycle.
This fills the multicast-capable path without making identity claims about an unauthenticated UDP response. It composes with #36: this helper finds the plaintext responder port for a known host, #36 can query /oic/res there for the advertised secure endpoint, and the existing DTLS probe plus authenticated session validate the final candidate.
The first two request profiles match the working appliance integration. The filtered legacy fallback covers the older TV and soundbar behavior reported on #36 without narrowing the requests used by the installed washer/dryer generations.
The helper uses one monotonic deadline across at most four rounds, caps received datagrams and distinct ports, closes its socket on every return path, and fails closed if too many ports answer.
Validation