vfs_fruit: Time Machine/FULLSYNC: add mDNS/DNS-SD advertisement

Omri Mor omri50 at gmail.com
Mon Jul 24 02:53:18 UTC 2017

>> I’ve looked into it a bit further.  It looks like dns_sd support was never
>> exposed in Waf build and was only available in autoconf.  Autoconf was removed
>> four years ago in cd4b413; I only found FreeBSD to be patching in dns_sd
>> support to the Waf build (more below).  When I added —enable-dnssd as an
>> option to the Waf build (defining WITH_DNSSD_SUPPORT and linking to Avahi’s
>> dns_sd compatibility library), the build broke: source3/client/dnsbrowse.c
>> attempts to TALLOC_FREE a nonexistent variable ‘fdset’.  There *are* reference
>> to an (unused) fdsetz variable, but it is defined as an int, not a pointer.
> <https://svnweb.freebsd.org/ports/head/net/samba46/files/patch-source3__client__dnsbrowse.c?view=markup>

Yes, I saw that—that’s (part of) the FreeBSD patch I was referring to.

>> That enabling dns_sd results in compilation errors signifies to me that *no
>> one* is using it.  Working around the problems in dnsbrowse.c (by commenting
>> out the code), dnsregister.c does exactly what I expected it to do: deregister
>> the service almost immediately.
>> In short, all support for dns_sd in Samba appears to be broken and is not
>> being maintained.
> Looks like. But at least FreeBSD has patches so it might be working there and
> someone might be using it.

They are *partly* using it.
With the above dnsbrowse.c patch, I *think* smbclient supports mDNS browsing, though I’m having trouble verifying.
However, dnsregister.c doesn’t work.
The reason I suspect no one has noticed this is that FreeBSD links with *both* Avahi *and* dns_sd.
So while registering with dns_sd is broken, Avahi works fine.
In fact, if both worked correctly, I suspect that they would see *more* problems, due to the presence of two separate mDNS/DNS-SD implementations running concurrently.
Since they *already* link to Avahi, I think it makes more sense to replace the dns_sd code for browsing in smbclient with Avahi.
This will have the further benefit of introducing this feature to Linux systems (currently it prints "DNS-SD browsing is not supported on this platform”).

>> What are your thoughts on simply removing the dns_sd code?
> I have no idea. As long as it doesn't hurt or cause actuall work I'd say let's
> keep it. Picking up the patches from FreeBSD would be nice.

Properly fixing it would need actual work, work that is probably better used elsewhere.

I’ll open up a separate thread about it.


More information about the samba-technical mailing list