You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now operational and commissionable DNS-SD advertising on Darwin uses the default hostname of the device involved, because we are passing NULL for the host argument when calling DNSServiceRegister.
Per spec, the hostname is supposed to be the MAC (or whatever randomized thing we are pretending is the MAC).
I tried implemeting this as follows:
Modify Register in src/platform/Darwin/DnssdImpl.cpp to take a hostname argument.
Pass service->mHostName to Register from ChipDnssdPublishService in that file.
That fixes the advertisements to have the right hostname, afaict, but address resolution then fails because there is no IP associated with that hostname. The documentation at https://developer.apple.com/documentation/dnssd/1804733-dnsserviceregister?language=objc says to call DNSServiceRegisterRecord to handle that, but I could not figure out the right arguments to pass it, even when hard-coding the relevant IPs, to get past "invalid argument" errors it was giving me.
Proposed Solution
Figure out whether the combination of passing a hostname to DNSServiceRegister and calling DNSServiceRegisterRecord is actually what we want to be doing here.
If so, sort out how to actually call DNSServiceRegisterRecord properly.
The text was updated successfully, but these errors were encountered:
Would it be easier to update the spec to only recommend using the mac as hostname?
Or does that potentially cause issues because macs (or other devices) may have overly long hostnames that devices then fail to work with due to embedded constrains?
Or does that potentially cause issues because macs (or other devices) may have overly long hostnames that devices then fail to work with due to embedded constrains?
Exactly. We ran into this because minmdns was using a buffer sized to the spec thing and failing out if the hostname did not
fit in there, iirc.
Problem
Right now operational and commissionable DNS-SD advertising on Darwin uses the default hostname of the device involved, because we are passing
NULL
for thehost
argument when callingDNSServiceRegister
.Per spec, the hostname is supposed to be the MAC (or whatever randomized thing we are pretending is the MAC).
I tried implemeting this as follows:
Register
insrc/platform/Darwin/DnssdImpl.cpp
to take ahostname
argument.service->mHostName
toRegister
fromChipDnssdPublishService
in that file.Register
:hostname
toDNSServiceRegister
.That fixes the advertisements to have the right hostname, afaict, but address resolution then fails because there is no IP associated with that hostname. The documentation at https://developer.apple.com/documentation/dnssd/1804733-dnsserviceregister?language=objc says to call DNSServiceRegisterRecord to handle that, but I could not figure out the right arguments to pass it, even when hard-coding the relevant IPs, to get past "invalid argument" errors it was giving me.
Proposed Solution
DNSServiceRegister
and callingDNSServiceRegisterRecord
is actually what we want to be doing here.DNSServiceRegisterRecord
properly.The text was updated successfully, but these errors were encountered: